@dynatrace-sdk/client-notification-v2

Manage resource/event notifications with the Notification Service API.
Installation
npm install @dynatrace-sdk/client-notification-v2
Getting help
License
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
API reference
Full API reference for the latest version of the SDK is also available at the Dynatrace Developer.
eventNotificationsClient
import { eventNotificationsClient } from '@dynatrace-sdk/client-notification-v2';
createEventNotification
eventNotificationsClient.createEventNotification(config): Promise<EventNotification>
Required scope: notification:notifications:write
Parameters
Returns
Throws
| Error Type | Error 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
| Name | Type | Description |
| config.id*required | string | A UUID string identifying this self notification. |
Returns
| Return type | Status code | Description |
| void | 204 | No response body |
Throws
| Error Type | Error 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
| Name | Type | Description |
| config.id*required | string | A UUID string identifying this self notification. |
Returns
Throws
| Error Type | Error 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
| Name | Type | Description |
| config.appId | string | Application id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger. |
| config.limit | number | Number of results to return per page. |
| config.notificationType | string | String 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.offset | number | The initial index from which to return the results. |
| config.ordering | string | Which field to use when ordering the results. |
| config.owner | string | |
| config.resourceId | string | Unique 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.search | string | A search term. |
Returns
Throws
| Error Type | Error 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
Returns
Throws
| Error Type | Error 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
Returns
Throws
| Error Type | Error 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
Returns
Throws
| Error Type | Error 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
| Name | Type | Description |
| config.appId | string | Application id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger. |
| config.id*required | string | A UUID string identifying this resource notification. |
Returns
| Return type | Status code | Description |
| void | 204 | No response body |
Throws
| Error Type | Error 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
| Name | Type | Description |
| config.appId | string | Application id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger. |
| config.notificationType*required | string | String 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*required | string | Unique 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 type | Status code | Description |
| void | 204 | No response body |
Throws
| Error Type | Error 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
| Name | Type | Description |
| config.appId | string | Application id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger. |
| config.id*required | string | A UUID string identifying this resource notification. |
Returns
Throws
| Error Type | Error 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
| Name | Type | Description |
| config.appId | string | Application id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger. |
| config.limit | number | Number of results to return per page. |
| config.notificationType | string | String 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.offset | number | The initial index from which to return the results. |
| config.ordering | string | Which field to use when ordering the results. |
| config.resourceId | string | Unique 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.search | string | A search term. |
Returns
Throws
| Error Type | Error Message |
| ErrorEnvelopeError | |
Code example
import { resourceNotificationsClient } from "@dynatrace-sdk/client-notification-v2";
const data =
await resourceNotificationsClient.getResourceNotifications();
Types
DavisEventConfig
| Name | Type | Description |
| customFilter | null | string | Additional DQL matcher expression to further filter events to match. default: "" |
| entityTags | null | EntityTags | |
| entityTagsMatch | null | "all" | "any" | |
| maintenanceWindowTriggerBehavior | "always" | "inside" | "outside" | default: "always" |
| names | null | Array<DavisEventName> | |
onProblemCloseDEPRECATED | boolean | Trigger on Davis event open only or also on close. Deprecated — use triggerOn instead. default: false |
| triggerOn | null | "open" | "open-and-close" | "close" | Event state to trigger on. "open" (active only), "open-and-close" (both phases), or "close" (closure only). When unset, falls back to onProblemClose for backward compatibility. |
typesDEPRECATED | null | Array<string> | |
DavisEventName
| Name | Type | Description |
| match*required | "equals" | "contains" | Davis event name must equal or contain the string provided. |
| name*required | string | |
DavisEventTriggerConfig
DavisProblemCategories
DavisProblemConfig
| Name | Type | Description |
| analysisReady | boolean | Run only after first root cause analysis run completed. default: false |
| categories*required | DavisProblemCategories | |
| customFilter | null | string | Additional DQL matcher expression to further filter events to match. default: "" |
| entityTags | null | EntityTags | |
| entityTagsMatch | null | "all" | "any" | |
onProblemCloseDEPRECATED | boolean | Trigger on Davis problem open only or also on close. Deprecated — use triggerOn instead. default: false |
| problemOpenDuration | null | 5 | 10 | 15 | 30 | 60 | 120 | 240 | 1440 | 10080 | Minimum problem duration in minutes before the trigger fires. |
| severityThreshold | null | number | Triggers 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. |
| triggerOn | null | "open" | "open-and-close" | "close" | Problem state to trigger on. "open" (active only), "open-and-close" (both phases), or "close" (closure only). When unset, falls back to onProblemClose for backward compatibility. |
| triggerOnUpdateFields | Array<"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
Entity tags to match by key and (optional) values. For example {"foo": [], "bar": ["a", "b", "c"]}
type: Record<string, string | string[]>
Error
ErrorDetails
ErrorEnvelope
| Name | Type |
| error*required | Error |
EventNotification
| Name | Type | Description |
| appId | string | App id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger. |
| id*required | string | |
| input | EventNotificationInput | Input 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*required | ModificationInfo | |
| notificationType*required | string | String 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*required | string | |
| resourceId*required | string | Unique 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. |
| title | string | |
| triggerConfiguration*required | EventTriggerConfig | |
EventNotificationRequest
| Name | Type | Description |
| appId | string | App id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger. |
| id | string | |
| input | EventNotificationInput | Input 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*required | string | String 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*required | string | Unique 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. |
| title | string | |
| triggerConfiguration*required | EventTriggerConfig | |
EventNotificationUpdate
| Name | Type | Description |
| appId | string | App id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger. |
| input | EventNotificationInput | Input 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 | string | String 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 | string | Unique 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. |
| title | string | |
| triggerConfiguration | EventTriggerConfig | |
EventQuery
| Name | Type | Description |
| eventType | "events" | "bizevents" | "dt.system.events" | "security.events" | Grail event type. |
| query*required | string | DQL matcher expression defining which events to match. |
EventQueryTriggerConfig
| Name | Type |
| type*required | "event" |
| value*required | EventQuery |
ModificationInfo
| Name | Type |
| createdBy*required | null | string |
| createdTime*required | Date |
| lastModifiedBy*required | null | string |
| lastModifiedTime*required | Date |
PaginatedEventNotificationList
PaginatedResourceNotificationList
ResourceNotification
| Name | Type | Description |
| appId | null | string | App id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger. |
| id*required | string | |
| modificationInfo*required | ModificationInfo | |
| notificationType*required | string | String 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*required | string | |
| resourceId*required | string | Unique 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
| Name | Type | Description |
| appId | null | string | App id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger. |
| notificationType*required | string | String 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*required | string | Unique 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: <a href="#eventquerytriggerconfig">EventQueryTriggerConfig</a> | <a href="#davisproblemtriggerconfig" target="_blank" rel="noopener noreferrer">DavisProblemTriggerConfig</a> | <a href="#daviseventtriggerconfig">DavisEventTriggerConfig</a>
Enums
DavisEventNameMatch
⚠️ Deprecated
Use literal values.
Davis event name must equal or contain the string provided.
Enum keys
DavisEventTriggerConfigType
⚠️ Deprecated
Use literal values.
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.
⚠️ Deprecated
Use literal values.
Event must match all or any of the entity tags.
Enum keys
EventQueryTriggerConfigType
⚠️ Deprecated
Use literal values.
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
TriggerOn
⚠️ Deprecated
Use literal values.
Enum keys
Close | Open | OpenAndClose
TriggerOnUpdateFields
⚠️ Deprecated
Use literal values.
Enum keys
DtDavisAffectedUsersCount | DtDavisImpactLevel | EventCategory | EventSeverity | RootCauseEntityId | SmartscapeAffectedEntities