2.0.1 • Published 7 months ago

@dynatrace-sdk/client-notification v2.0.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
7 months ago

@dynatrace-sdk/client-notification

npm License

Manage self notifications with the Notification Service API.

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

NameType
config.body*requiredSelfNotificationCreate

Returns

Return typeStatus codeDescription
SelfNotification201

Throws

Error TypeError Message
ErrorEnvelopeError
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

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

deleteSelfNotification

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
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

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

getSelfNotification

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
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

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

getSelfNotifications

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
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

const data =
  await selfNotificationsClient.getSelfNotifications();

patchSelfNotification

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
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

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

updateSelfNotification

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
import { selfNotificationsClient } from "@dynatrace-sdk/client-notification";

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

Types

DavisEventConfig

NameTypeDescription
customFilterstringAdditional DQL matcher expression to further filter events to match.
entityTagsEntityTagsEntity tags to match by key and (optional) values. For example {"foo": [], "bar": "a", "b", "c"}
entityTagsMatch"all" | "any"Event must match all or any of the entity tags.
namesArray<DavisEventName>
onProblemClosebooleanTrigger on Davis event open only or also on close. default: false
typesDEPRECATEDArray<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

NameType
availabilityboolean
customboolean
errorboolean
infoboolean
monitoringUnavailableboolean
resourceboolean
slowdownboolean

DavisProblemConfig

NameTypeDescription
categories*requiredDavisProblemCategories
customFilterstringAdditional DQL matcher expression to further filter events to match.
entityTagsEntityTagsEntity tags to match by key and (optional) values. For example {"foo": [], "bar": "a", "b", "c"}
entityTagsMatch"all" | "any"Event must match all or any of the entity tags.
onProblemClosebooleanTrigger on Davis problem open only or also on close. default: false

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[] | undefined>

Error

NameType
code*requirednumber
detailsErrorDetails
message*requiredstring

ErrorDetails

type: Record<string, any>

ErrorEnvelope

NameType
error*requiredError

EventQuery

NameTypeDescription
eventType"events" | "bizevents" | "dt.system.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
inputSelfNotificationInputSelfNotificationInput 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
inputSelfNotificationInputSelfNotificationInput 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
contentstring
subjectstring

SelfNotificationUpdate

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

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 | DtSystemEvents | Events

1.8.1

11 months ago

1.8.0

11 months ago

1.7.0

12 months ago

2.0.1

7 months ago

1.5.0

1 year ago

1.4.0

1 year ago