1.5.0 • Published 8 months ago

@dynatrace-sdk/client-notification v1.5.0

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

@dynatrace-sdk/client-notification

npm License

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

NameType
config.body*requiredSelfNotificationRequest

Throws

Error TypeError 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

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

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.

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.

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*requiredPatchedSelfNotificationRequest
config.id*requiredstringA UUID string identifying this self notification.

Throws

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

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

updateSelfNotification

Required scope: notification:self-notifications:write

Parameters

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

Throws

Error TypeError 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.

NameTypeDescription
causeany
errorType*requiredErrorType
isApiClientError*requiredtrue
message*requiredstring
name*requiredstring
stackstring
prepareStackTraceObjectOptional override for formatting stack traces
stackTraceLimit*requirednumber

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.

NameTypeDescription
body*requiredApiGatewayErrorResponseBody
causeany
code*requirednumber
errorType*requiredErrorType
isApiClientError*requiredtrue
isApiGatewayError*requiredtrue
isClientRequestError*requiredtrue
message*requiredstring
name*requiredstring
response*requiredHttpClientResponse
retryAfterSeconds*requiredundefined | number
stackstring
prepareStackTraceObjectOptional override for formatting stack traces
stackTraceLimit*requirednumber

ClientRequestError

Generic error class for service errors, used to handle both expected and unexpected service-level errors.

NameTypeDescription
body*requiredDTO
causeany
errorType*requiredErrorType
isApiClientError*requiredtrue
isClientRequestError*requiredtrue
message*requiredstring
name*requiredstring
response*requiredHttpClientResponse
stackstring
prepareStackTraceObjectOptional override for formatting stack traces
stackTraceLimit*requirednumber

ErrorEnvelopeError

Generic error class for service errors, used to handle both expected and unexpected service-level errors.

NameTypeDescription
body*requiredErrorEnvelope
causeany
errorType*requiredErrorType
isApiClientError*requiredtrue
isClientRequestError*requiredtrue
isErrorEnvelopeError*requiredtrue
message*requiredstring
name*requiredstring
response*requiredHttpClientResponse
stackstring
prepareStackTraceObjectOptional override for formatting stack traces
stackTraceLimit*requirednumber

InvalidResponseError

Dedicated error class for errors related to response serialization. Thrown when received service response can't be deserialized.

NameTypeDescription
causeany
errorType*requiredErrorType
expectedTypestring
isApiClientError*requiredtrue
isInvalidResponseError*requiredtrue
message*requiredstring
name*requiredstring
nestedErrorError
response*requiredany
responseBody*requiredany
stackstring
prepareStackTraceObjectOptional override for formatting stack traces
stackTraceLimit*requirednumber

DavisEventConfig

NameTypeDescription
customFilterstringAdditional DQL matcher expression to further filter events to match.
entityTagsEntityTagsdefault: {}
entityTagsMatchEntityTagsMatchEvent 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*requiredDavisEventNameMatchDavis event name must equal or contain the string provided.
name*requiredstring

DavisEventTriggerConfig

NameType
type*requiredDavisEvent
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.
entityTagsEntityTagsdefault: {}
entityTagsMatchEntityTagsMatchEvent must match all or any of the entity tags.
onProblemClosebooleanTrigger on Davis problem open only or also on close. default: false

DavisProblemTriggerConfig

NameType
type*requiredDavisProblem
value*requiredDavisProblemConfig

EntityTags

type: Record<string, MaybeStringArray | undefined>

Entity tags to match by key and (optional) values. For example {"foo": [], "bar": "a", "b", "c"}

Error

NameType
detailsErrorDetails
message*requiredstring

ErrorDetails

type: Record<string, any>

ErrorEnvelope

NameType
error*requiredError

EventQuery

NameTypeDescription
eventTypeEventTypedefault: "events"
query*requiredstringDQL matcher expression defining which events to match.

EventQueryTriggerConfig

NameType
type*requiredEvent
value*requiredEventQuery

ModificationInfo

NameType
createdBy*requiredstring
createdTime*requiredDate
lastModifiedBy*requiredstring
lastModifiedTime*requiredDate

PaginatedSelfNotificationList

NameType
count*requirednumber
results*requiredArray<SelfNotification>

PatchedSelfNotificationRequest

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

SelfNotification

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

SelfNotificationRequest

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

SendDefaultNotificationInput

NameType
content*requiredstring
subject*requiredstring

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

1.5.0

8 months ago

1.4.0

10 months ago