@dynatrace-sdk/client-notification
Manage self notifications with the Notification Service API.
npm install @dynatrace-sdk/client-notification
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Full API reference for the latest version of the SDK is also available at the Dynatrace Developer.
import { selfNotificationsClient } from '@dynatrace-sdk/client-notification';
selfNotificationsClient.createSelfNotification(config): Promise<SelfNotification>
Required scope: notification:self-notifications:write
Error Type |
Error Message |
ErrorEnvelopeError |
|
Code example
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.createSelfNotification({
body: {
resourceId: "...",
notificationType: "...",
triggerConfiguration: {
type: EventQueryTriggerConfigType.Event,
value: { query: "..." },
},
},
});
selfNotificationsClient.deleteSelfNotification(config): Promise<void>
Required scope: notification:self-notifications:write
Name |
Type |
Description |
config.id*required
|
string |
A UUID string identifying this self notification. |
Return type |
Status code |
Description |
void |
204 |
No response body |
Error Type |
Error Message |
ErrorEnvelopeError |
|
Code example
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.deleteSelfNotification({
id: "...",
});
selfNotificationsClient.getSelfNotification(config): Promise<SelfNotification>
Required scope: notification:self-notifications:read
Name |
Type |
Description |
config.id*required
|
string |
A UUID string identifying this self notification. |
Error Type |
Error Message |
ErrorEnvelopeError |
|
Code example
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.getSelfNotification({
id: "...",
});
selfNotificationsClient.getSelfNotifications(config): Promise<PaginatedSelfNotificationList>
Required scope: notification:self-notifications:read
Name |
Type |
Description |
config.appId |
string |
|
config.limit |
number |
Number of results to return per page. |
config.notificationType |
string |
|
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 |
|
config.search |
string |
A search term. |
Error Type |
Error Message |
ErrorEnvelopeError |
|
Code example
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.getSelfNotifications();
selfNotificationsClient.patchSelfNotification(config): Promise<SelfNotification>
Required scope: notification:self-notifications:write
Error Type |
Error Message |
ErrorEnvelopeError |
|
Code example
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.patchSelfNotification({
id: "...",
body: {
triggerConfiguration: {
type: EventQueryTriggerConfigType.Event,
value: { query: "..." },
},
},
});
selfNotificationsClient.updateSelfNotification(config): Promise<SelfNotification>
Required scope: notification:self-notifications:write
Error Type |
Error Message |
ErrorEnvelopeError |
|
Code example
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.updateSelfNotification({
id: "...",
body: {
resourceId: "...",
notificationType: "...",
triggerConfiguration: {
type: EventQueryTriggerConfigType.Event,
value: { query: "..." },
},
},
});
Name |
Type |
Description |
customFilter |
string |
Additional DQL matcher expression to further filter events to match. |
entityTags |
EntityTags |
default: {}
|
entityTagsMatch |
"all" | "any" |
Event must match all or any of the entity tags. |
names |
Array<DavisEventName> |
|
onProblemClose |
boolean |
Trigger on Davis event open only or also on close. default: false
|
typesDEPRECATED
|
Array<string> |
|
Name |
Type |
Description |
match*required
|
"equals" | "contains" |
Davis event name must equal or contain the string provided. |
name*required
|
string |
|
Name |
Type |
Description |
categories*required
|
DavisProblemCategories |
|
customFilter |
string |
Additional DQL matcher expression to further filter events to match. |
entityTags |
EntityTags |
default: {}
|
entityTagsMatch |
"all" | "any" |
Event must match all or any of the entity tags. |
onProblemClose |
boolean |
Trigger on Davis problem open only or also on close. default: false
|
DavisProblemTriggerConfig
Entity tags to match by key and (optional) values. For example {"foo": [], "bar": ["a", "b", "c"]}
type: Record<string, MaybeStringArray | undefined>
type: Record<string, any>
Name |
Type |
error*required
|
Error |
Name |
Type |
Description |
eventType |
"events" | "bizevents" | "dt.system.events" |
default: "events"
|
query*required
|
string |
DQL matcher expression defining which events to match. |
Name |
Type |
type*required
|
"event" |
value*required
|
EventQuery |
Name |
Type |
createdBy*required
|
string |
createdTime*required
|
Date |
lastModifiedBy*required
|
string |
lastModifiedTime*required
|
Date |
PaginatedSelfNotificationList
PatchedSelfNotificationRequest
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 |
SendDefaultNotificationInput |
SendDefaultNotificationInput 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 |
|
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 |
SendDefaultNotificationInput |
SendDefaultNotificationInput 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 |
|
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 |
SendDefaultNotificationInput |
SendDefaultNotificationInput 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 |
|
SendDefaultNotificationInput
Davis event name must equal or contain the string provided.
DavisEventTriggerConfigType
DavisProblemTriggerConfigType
Event must match all or any of the entity tags.
EventQueryTriggerConfigType
Grail event type.
Bizevents
| DtSystemEvents
| Events