Skip to main content

Notification v2

  • Reference

Manage resource/event notifications with the Notification Service API.

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

eventNotificationsClient

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

createEventNotification

eventNotificationsClient.createEventNotification(config): Promise<EventNotification>

Required scope: notification:notifications:write

Parameters

NameType
config.body*requiredEventNotificationRequest

Returns

Return typeStatus codeDescription
EventNotification201

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

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

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

deleteEventNotification

eventNotificationsClient.deleteEventNotification(config): Promise<void>

Required scope: notification: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 { eventNotificationsClient } from "@dynatrace-sdk/client-notification-v2";

const data =
await eventNotificationsClient.deleteEventNotification({
id: "...",
});

getEventNotification

eventNotificationsClient.getEventNotification(config): Promise<EventNotification>

Required scope: notification:notifications:read

Parameters

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

Returns

Return typeStatus codeDescription
EventNotification200

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

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

const data =
await eventNotificationsClient.getEventNotification({
id: "...",
});

getEventNotifications

eventNotificationsClient.getEventNotifications(config): Promise<PaginatedEventNotificationList>

Required scope: notification:notifications:read

Parameters

NameTypeDescription
config.appIdstringApplication id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger.
config.limitnumberNumber of results to return per page.
config.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.
config.offsetnumberThe initial index from which to return the results.
config.orderingstringWhich field to use when ordering the results.
config.ownerstring
config.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.
config.searchstringA search term.

Returns

Return typeStatus codeDescription
PaginatedEventNotificationList200

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

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

const data =
await eventNotificationsClient.getEventNotifications();

patchEventNotification

eventNotificationsClient.patchEventNotification(config): Promise<EventNotification>

Required scope: notification:notifications:write

Parameters

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

Returns

Return typeStatus codeDescription
EventNotification200

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

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

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

updateEventNotification

eventNotificationsClient.updateEventNotification(config): Promise<EventNotification>

Required scope: notification:notifications:write

Parameters

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

Returns

Return typeStatus codeDescription
EventNotification200

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

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

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

resourceNotificationsClient

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

createResourceNotification

resourceNotificationsClient.createResourceNotification(config): Promise<ResourceNotification>

Required scope: notification:notifications:write

Parameters

NameType
config.body*requiredResourceNotificationRequest

Returns

Return typeStatus codeDescription
ResourceNotification201

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

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

const data =
await resourceNotificationsClient.createResourceNotification(
{
body: { notificationType: "...", resourceId: "..." },
},
);

deleteResourceNotification

resourceNotificationsClient.deleteResourceNotification(config): Promise<void>

Required scope: notification:notifications:write

Parameters

NameTypeDescription
config.appIdstringApplication id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger.
config.id*requiredstringA UUID string identifying this resource notification.

Returns

Return typeStatus codeDescription
void204No response body

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

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

const data =
await resourceNotificationsClient.deleteResourceNotification(
{ id: "..." },
);

deleteResourceNotificationByTypeAndResource

resourceNotificationsClient.deleteResourceNotificationByTypeAndResource(config): Promise<void>

Required scope: notification:notifications:write

Parameters

NameTypeDescription
config.appIdstringApplication id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger.
config.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.
config.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.

Returns

Return typeStatus codeDescription
void204No response body

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

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

const data =
await resourceNotificationsClient.deleteResourceNotificationByTypeAndResource(
{ notificationType: "...", resourceId: "..." },
);

getResourceNotification

resourceNotificationsClient.getResourceNotification(config): Promise<ResourceNotification>

Required scope: notification:notifications:read

Parameters

NameTypeDescription
config.appIdstringApplication id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger.
config.id*requiredstringA UUID string identifying this resource notification.

Returns

Return typeStatus codeDescription
ResourceNotification200

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

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

const data =
await resourceNotificationsClient.getResourceNotification(
{ id: "..." },
);

getResourceNotifications

resourceNotificationsClient.getResourceNotifications(config): Promise<PaginatedResourceNotificationList>

Required scope: notification:notifications:read

Parameters

NameTypeDescription
config.appIdstringApplication id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger.
config.limitnumberNumber of results to return per page.
config.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.
config.offsetnumberThe initial index from which to return the results.
config.orderingstringWhich field to use when ordering the results.
config.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.
config.searchstringA search term.

Returns

Return typeStatus codeDescription
PaginatedResourceNotificationList200

Throws

Error TypeError Message
ErrorEnvelopeError

Code example

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

const data =
await resourceNotificationsClient.getResourceNotifications();

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

EventNotification

NameTypeDescription
appIdstringApp id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger.
id*requiredstring
inputEventNotificationInputInput 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

EventNotificationInput

NameType
contentnull | string
subjectnull | string

EventNotificationRequest

NameTypeDescription
appIdstringApp id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger.
idstring
inputEventNotificationInputInput 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

EventNotificationUpdate

NameTypeDescription
appIdstringApp id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger.
inputEventNotificationInputInput 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

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

PaginatedEventNotificationList

NameType
count*requirednumber
results*requiredArray<EventNotification>

PaginatedResourceNotificationList

NameType
count*requirednumber
results*requiredArray<ResourceNotification>

ResourceNotification

NameTypeDescription
appIdnull | stringApp id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger.
id*requiredstring
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.
owningUser*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.

ResourceNotificationRequest

NameTypeDescription
appIdnull | stringApp id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger.
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.

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