Skip to main content

Notification

  • Reference

Manage self notifications with the Notification Service API. This is deprecated, use event notifications provided in the Notification Service v2 API instead.

Latest (V2)
npm install @dynatrace-sdk/client-notification

selfNotificationsClient

import { selfNotificationsClient } from '@dynatrace-sdk/client-notification';

createSelfNotification

⚠️ Deprecated

selfNotificationsClient.createSelfNotification(config): Promise<SelfNotification>

Required scope: notification:self-notifications:write

Parameters

NameType
config.body*requiredSelfNotificationCreate

Returns

Return typeStatus codeDescription
SelfNotification201

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

const data =
await selfNotificationsClient.createSelfNotification({
body: {
resourceId: "...",
notificationType: "...",
triggerConfiguration: {
type: "event",
value: { query: "..." },
},
},
});

deleteSelfNotification

⚠️ Deprecated

selfNotificationsClient.deleteSelfNotification(config): Promise<void>

Required scope: notification:self-notifications:write

Parameters

NameTypeDescription
config.id*requiredstringA UUID string identifying this self notification.

Returns

Return typeStatus codeDescription
void204No response body

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

const data =
await selfNotificationsClient.deleteSelfNotification({
id: "...",
});

getSelfNotification

⚠️ Deprecated

selfNotificationsClient.getSelfNotification(config): Promise<SelfNotification>

Required scope: notification:self-notifications:read

Parameters

NameTypeDescription
config.id*requiredstringA UUID string identifying this self notification.

Returns

Return typeStatus codeDescription
SelfNotification200

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

const data =
await selfNotificationsClient.getSelfNotification({
id: "...",
});

getSelfNotifications

⚠️ Deprecated

selfNotificationsClient.getSelfNotifications(config): Promise<PaginatedSelfNotificationList>

Required scope: notification:self-notifications:read

Parameters

NameTypeDescription
config.appIdstring
config.limitnumberNumber of results to return per page.
config.notificationTypestring
config.offsetnumberThe initial index from which to return the results.
config.orderingstringWhich field to use when ordering the results.
config.ownerstring
config.resourceIdstring
config.searchstringA search term.

Returns

Return typeStatus codeDescription
PaginatedSelfNotificationList200

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

const data =
await selfNotificationsClient.getSelfNotifications();

patchSelfNotification

⚠️ Deprecated

selfNotificationsClient.patchSelfNotification(config): Promise<SelfNotification>

Required scope: notification:self-notifications:write

Parameters

NameTypeDescription
config.body*requiredSelfNotificationUpdate
config.id*requiredstringA UUID string identifying this self notification.

Returns

Return typeStatus codeDescription
SelfNotification200

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

const data =
await selfNotificationsClient.patchSelfNotification({
id: "...",
body: {
triggerConfiguration: {
type: "event",
value: { query: "..." },
},
},
});

updateSelfNotification

⚠️ Deprecated

selfNotificationsClient.updateSelfNotification(config): Promise<SelfNotification>

Required scope: notification:self-notifications:write

Parameters

NameTypeDescription
config.body*requiredSelfNotificationUpdate
config.id*requiredstringA UUID string identifying this self notification.

Returns

Return typeStatus codeDescription
SelfNotification200

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

const data =
await selfNotificationsClient.updateSelfNotification({
id: "...",
body: {
triggerConfiguration: {
type: "event",
value: { query: "..." },
},
},
});

Types

DavisEventConfig

NameTypeDescription
customFilternull | stringAdditional DQL matcher expression to further filter events to match. default: ""
entityTagsnull | EntityTags
entityTagsMatchnull | "all" | "any"
maintenanceWindowTriggerBehavior"always" | "inside" | "outside"default: "always"
namesnull | Array<DavisEventName>
onProblemClosebooleanTrigger on Davis event open only or also on close. default: false
typesDEPRECATEDnull | Array<string>

DavisEventName

NameTypeDescription
match*required"equals" | "contains"Davis event name must equal or contain the string provided.
name*requiredstring

DavisEventTriggerConfig

NameType
type*required"davis-event"
value*requiredDavisEventConfig

DavisProblemCategories

NameTypeDefault
availabilitybooleanfalse
custombooleanfalse
errorbooleanfalse
infobooleanfalse
monitoringUnavailablebooleanfalse
resourcebooleanfalse
slowdownbooleanfalse

DavisProblemConfig

NameTypeDescription
analysisReadybooleanRun only after first root cause analysis run completed. default: false
categories*requiredDavisProblemCategories
customFilternull | stringAdditional DQL matcher expression to further filter events to match. default: ""
entityTagsnull | EntityTags
entityTagsMatchnull | "all" | "any"
onProblemClosebooleanTrigger on Davis problem open only or also on close. default: false
problemOpenDurationnull | 5 | 10 | 15 | 30 | 60 | 120 | 240 | 1440 | 10080Minimum problem duration in minutes before the trigger fires.
severityThresholdnull | numberTriggers only for problems whose severity is this value or more severe. Lower numbers are more severe (1 = critical, 5 = informational), so 3 matches severities 1, 2, and 3.
triggerOnUpdateFieldsArray<"dt.davis.affected_users_count" | "dt.davis.impact_level" | "event.category" | "event.severity" | "root_cause_entity_id" | "smartscape.affected_entities">Problem event fields tracked for value changes. Changes to any selected field cause re-triggering.

DavisProblemTriggerConfig

NameType
type*required"davis-problem"
value*requiredDavisProblemConfig

EntityTags

Entity tags to match by key and (optional) values. For example {"foo": [], "bar": ["a", "b", "c"]}

type: Record<string, string | string[]>

Error

NameType
code*requirednumber
detailsErrorDetails
message*requiredstring

ErrorDetails

NameType
errorCodestring
errorRefstring

ErrorEnvelope

NameType
error*requiredError

EventQuery

NameTypeDescription
eventType"events" | "bizevents" | "dt.system.events" | "security.events"Grail event type.
query*requiredstringDQL matcher expression defining which events to match.

EventQueryTriggerConfig

NameType
type*required"event"
value*requiredEventQuery

ModificationInfo

NameType
createdBy*requirednull | string
createdTime*requiredDate
lastModifiedBy*requirednull | string
lastModifiedTime*requiredDate

PaginatedSelfNotificationList

NameType
count*requirednumber
results*requiredArray<SelfNotification>

SelfNotification

NameTypeDescription
appIdstringApp id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger.
id*requiredstring
inputSelfNotificationInputInput object consisting of subject and content. Supports automation expressions https://dt-url.net/workflows-expression-reference and markdown syntax. A template provided with an app ({notification_type}.notification-template.json) will take precedence over the input provided here.
modificationInfo*requiredModificationInfo
notificationType*requiredstringString that defines the type of a notification in context of an app. Allows to differentiate between multiple types of notifications in context of one app.
owner*requiredstring
resourceId*requiredstringUnique identifier of resource to notify on. Used to determine if there is a notification registered for a resource in context of the app and notification type for a user.
titlestring
triggerConfiguration*requiredEventTriggerConfig

SelfNotificationCreate

NameTypeDescription
appIdstringApp id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger.
idstring
inputSelfNotificationInputInput object consisting of subject and content. Supports automation expressions https://dt-url.net/workflows-expression-reference and markdown syntax. A template provided with an app ({notification_type}.notification-template.json) will take precedence over the input provided here.
notificationType*requiredstringString that defines the type of a notification in context of an app. Allows to differentiate between multiple types of notifications in context of one app.
resourceId*requiredstringUnique identifier of resource to notify on. Used to determine if there is a notification registered for a resource in context of the app and notification type for a user.
titlestring
triggerConfiguration*requiredEventTriggerConfig

SelfNotificationInput

NameType
contentnull | string
subjectnull | string

SelfNotificationUpdate

NameTypeDescription
appIdstringApp id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger.
inputSelfNotificationInputInput object consisting of subject and content. Supports automation expressions https://dt-url.net/workflows-expression-reference and markdown syntax. A template provided with an app ({notification_type}.notification-template.json) will take precedence over the input provided here.
notificationTypestringString that defines the type of a notification in context of an app. Allows to differentiate between multiple types of notifications in context of one app.
resourceIdstringUnique identifier of resource to notify on. Used to determine if there is a notification registered for a resource in context of the app and notification type for a user.
titlestring
triggerConfigurationEventTriggerConfig

EventTriggerConfig

type: EventQueryTriggerConfig | DavisProblemTriggerConfig | DavisEventTriggerConfig

Enums

DavisEventNameMatch

⚠️ Deprecated Use literal values.

Davis event name must equal or contain the string provided.

Enum keys

Contains | Equals

DavisEventTriggerConfigType

⚠️ Deprecated Use literal values.

Enum keys

DavisEvent

DavisProblemConfigProblemOpenDuration

⚠️ Deprecated Use literal values.

Minimum problem duration in minutes before the trigger fires.

Enum keys

DavisProblemConfigProblemOpenDuration_10 | DavisProblemConfigProblemOpenDuration_10080 | DavisProblemConfigProblemOpenDuration_120 | DavisProblemConfigProblemOpenDuration_1440 | DavisProblemConfigProblemOpenDuration_15 | DavisProblemConfigProblemOpenDuration_240 | DavisProblemConfigProblemOpenDuration_30 | DavisProblemConfigProblemOpenDuration_5 | DavisProblemConfigProblemOpenDuration_60

DavisProblemTriggerConfigType

⚠️ Deprecated Use literal values.

Enum keys

DavisProblem

EntityTagsMatch

⚠️ Deprecated Use literal values.

Event must match all or any of the entity tags.

Enum keys

All | Any

EventQueryTriggerConfigType

⚠️ Deprecated Use literal values.

Enum keys

Event

EventType

⚠️ Deprecated Use literal values.

Grail event type.

Enum keys

Bizevents | DtSystemEvents | Events | SecurityEvents

MaintenanceWindowTriggerBehaviorType

⚠️ Deprecated Use literal values.

Specifies when to trigger based on maintenance window status.

Enum keys

Always | Inside | Outside

TriggerOnUpdateFields

⚠️ Deprecated Use literal values.

Enum keys

DtDavisAffectedUsersCount | DtDavisImpactLevel | EventCategory | EventSeverity | RootCauseEntityId | SmartscapeAffectedEntities

Still have questions?
Find answers in the Dynatrace Community