@dynatrace-sdk/client-notification

Notification Service API allows working with trigger configurations.
Installation
npm install @dynatrace-sdk/client-notification
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.
selfNotificationsClient
import { selfNotificationsClient } from '@dynatrace-sdk/client-notification';
createSelfNotification
Required scope: notification:self-notifications:write
Parameters
Name | Type |
---|
config.body*required | SelfNotificationRequest |
Throws
Error Type | Error Message |
---|
ErrorEnvelopeError | |
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.createSelfNotification({
body: { resourceId: "...", notificationType: "..." },
});
deleteSelfNotification
Required scope: notification:self-notifications:write
Parameters
Name | Type | Description |
---|
config.id*required | string | A UUID string identifying this self notification. |
Throws
Error Type | Error Message |
---|
ErrorEnvelopeError | |
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.deleteSelfNotification({
id: "...",
});
getSelfNotification
Required scope: notification:self-notifications:read
Parameters
Name | Type | Description |
---|
config.id*required | string | A UUID string identifying this self notification. |
Throws
Error Type | Error Message |
---|
ErrorEnvelopeError | |
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.getSelfNotification({
id: "...",
});
getSelfNotifications
Required scope: notification:self-notifications:read
Parameters
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. |
Throws
Error Type | Error Message |
---|
ErrorEnvelopeError | |
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.getSelfNotifications();
patchSelfNotification
Required scope: notification:self-notifications:write
Parameters
Name | Type | Description |
---|
config.body*required | PatchedSelfNotificationRequest | |
config.id*required | string | A UUID string identifying this self notification. |
Throws
Error Type | Error Message |
---|
ErrorEnvelopeError | |
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.patchSelfNotification({
id: "...",
body: {},
});
updateSelfNotification
Required scope: notification:self-notifications:write
Parameters
Name | Type | Description |
---|
config.body*required | SelfNotificationRequest | |
config.id*required | string | A UUID string identifying this self notification. |
Throws
Error Type | Error Message |
---|
ErrorEnvelopeError | |
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";
const data =
await selfNotificationsClient.updateSelfNotification({
id: "...",
body: { resourceId: "...", notificationType: "..." },
});
Types
ApiClientError
Base error for all client SDKs. All other errors extend this class.
Name | Type | Description |
---|
cause | any | |
errorType*required | ErrorType | |
isApiClientError*required | true | |
message*required | string | |
name*required | string | |
stack | string | |
prepareStackTrace | Object | Optional override for formatting stack traces |
stackTraceLimit*required | number | |
ApiGatewayError
Dedicated error response class for errors thrown by API Gateway.
Autogenerated SDK Clients have built-in handler for API Gateway errors that throws this error.
Name | Type | Description |
---|
body*required | ApiGatewayErrorResponseBody | |
cause | any | |
code*required | number | |
errorType*required | ErrorType | |
isApiClientError*required | true | |
isApiGatewayError*required | true | |
isClientRequestError*required | true | |
message*required | string | |
name*required | string | |
response*required | HttpClientResponse | |
retryAfterSeconds*required | undefined | number | |
stack | string | |
prepareStackTrace | Object | Optional override for formatting stack traces |
stackTraceLimit*required | number | |
ClientRequestError
Generic error class for service errors, used to handle both expected and unexpected service-level errors.
Name | Type | Description |
---|
body*required | DTO | |
cause | any | |
errorType*required | ErrorType | |
isApiClientError*required | true | |
isClientRequestError*required | true | |
message*required | string | |
name*required | string | |
response*required | HttpClientResponse | |
stack | string | |
prepareStackTrace | Object | Optional override for formatting stack traces |
stackTraceLimit*required | number | |
ErrorEnvelopeError
Generic error class for service errors, used to handle both expected and unexpected service-level errors.
Name | Type | Description |
---|
body*required | ErrorEnvelope | |
cause | any | |
errorType*required | ErrorType | |
isApiClientError*required | true | |
isClientRequestError*required | true | |
isErrorEnvelopeError*required | true | |
message*required | string | |
name*required | string | |
response*required | HttpClientResponse | |
stack | string | |
prepareStackTrace | Object | Optional override for formatting stack traces |
stackTraceLimit*required | number | |
InvalidResponseError
Dedicated error class for errors related to response serialization.
Thrown when received service response can't be deserialized.
Name | Type | Description |
---|
cause | any | |
errorType*required | ErrorType | |
expectedType | string | |
isApiClientError*required | true | |
isInvalidResponseError*required | true | |
message*required | string | |
name*required | string | |
nestedError | Error | |
response*required | any | |
responseBody*required | any | |
stack | string | |
prepareStackTrace | Object | Optional override for formatting stack traces |
stackTraceLimit*required | number | |
DavisEventConfig
Name | Type | Description |
---|
customFilter | string | Additional DQL matcher expression to further filter events to match. |
entityTags | EntityTags | default: {} |
entityTagsMatch | EntityTagsMatch | 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> | |
DavisEventName
Name | Type | Description |
---|
match*required | DavisEventNameMatch | Davis event name must equal or contain the string provided. |
name*required | string | |
DavisEventTriggerConfig
Name | Type |
---|
type*required | DavisEvent |
value*required | DavisEventConfig |
DavisProblemCategories
DavisProblemConfig
Name | Type | Description |
---|
categories*required | DavisProblemCategories | |
customFilter | string | Additional DQL matcher expression to further filter events to match. |
entityTags | EntityTags | default: {} |
entityTagsMatch | EntityTagsMatch | 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
Name | Type |
---|
type*required | DavisProblem |
value*required | DavisProblemConfig |
EntityTags
type: Record<string, MaybeStringArray | undefined>
Entity tags to match by key and (optional) values. For example {"foo": [], "bar": "a", "b", "c"}
Error
Name | Type |
---|
details | ErrorDetails |
message*required | string |
ErrorDetails
type: Record<string, any>
ErrorEnvelope
Name | Type |
---|
error*required | Error |
EventQuery
Name | Type | Description |
---|
eventType | EventType | default: "events" |
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 | string |
createdTime*required | Date |
lastModifiedBy*required | string |
lastModifiedTime*required | Date |
PaginatedSelfNotificationList
Name | Type |
---|
count*required | number |
results*required | Array<SelfNotification> |
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 | |
SelfNotification
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. |
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 | |
SelfNotificationRequest
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
Enums
DavisEventNameMatch
Davis event name must equal or contain the string provided.
Enum keys
Contains
| Equals
DavisEventTriggerConfigType
Enum keys
DavisEvent
DavisProblemTriggerConfigType
Enum keys
DavisProblem
EntityTagsMatch
Event must match all or any of the entity tags.
Enum keys
All
| Any
EventQueryTriggerConfigType
Enum keys
Event
EventType
Grail event type.
Enum keys
Bizevents
| Events