Skip to main content

    Notification v2

    Manage resource/event notifications with the Notification Service API.

    npm install @dynatrace-sdk/client-notification-v2

    eventNotificationsClient

    import { eventNotificationsClient } from '@dynatrace-sdk/client-notification-v2';

    createEventNotification

    eventNotificationsClient.createEventNotification(config): Promise<EventNotification>

    Required scope: notification:notifications:write

    Parameters

    NameType
    config.body*requiredEventNotificationRequest

    Returns

    Return typeStatus codeDescription
    EventNotification201

    Throws

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

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

    Returns

    Return typeStatus codeDescription
    void204No response body

    Throws

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

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

    Returns

    Return typeStatus codeDescription
    EventNotification200

    Throws

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

    NameTypeDescription
    config.appIdstringApplication id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger.
    config.limitnumberNumber of results to return per page.
    config.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.
    config.offsetnumberThe initial index from which to return the results.
    config.orderingstringWhich field to use when ordering the results.
    config.ownerstring
    config.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.
    config.searchstringA search term.

    Returns

    Return typeStatus codeDescription
    PaginatedEventNotificationList200

    Throws

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

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

    Returns

    Return typeStatus codeDescription
    EventNotification200

    Throws

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

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

    Returns

    Return typeStatus codeDescription
    EventNotification200

    Throws

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

    NameType
    config.body*requiredResourceNotificationRequest

    Returns

    Return typeStatus codeDescription
    ResourceNotification201

    Throws

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

    NameTypeDescription
    config.appIdstringApplication id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger.
    config.id*requiredstringA UUID string identifying this resource notification.

    Returns

    Return typeStatus codeDescription
    void204No response body

    Throws

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

    NameTypeDescription
    config.appIdstringApplication id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger.
    config.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.
    config.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.

    Returns

    Return typeStatus codeDescription
    void204No response body

    Throws

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

    NameTypeDescription
    config.appIdstringApplication id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger.
    config.id*requiredstringA UUID string identifying this resource notification.

    Returns

    Return typeStatus codeDescription
    ResourceNotification200

    Throws

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

    NameTypeDescription
    config.appIdstringApplication id associated with the notification. Optional, by default automatically inferred from the request header. Only relevant for manual testing purposes via swagger.
    config.limitnumberNumber of results to return per page.
    config.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.
    config.offsetnumberThe initial index from which to return the results.
    config.orderingstringWhich field to use when ordering the results.
    config.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.
    config.searchstringA search term.

    Returns

    Return typeStatus codeDescription
    PaginatedResourceNotificationList200

    Throws

    Error TypeError Message
    ErrorEnvelopeError

    Code example

    import { resourceNotificationsClient } from "@dynatrace-sdk/client-notification-v2";

    const data =
    await resourceNotificationsClient.getResourceNotifications();

    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

    NameTypeDescription
    code*requirednumber
    detailsErrorDetailsError response details according to API Guidelines
    message*requiredstring

    ErrorDetails

    Error response details according to API Guidelines

    NameType
    errorCodestring
    errorRefstring

    ErrorEnvelope

    NameType
    error*requiredError

    EventNotification

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

    EventNotificationInput

    NameType
    contentstring
    subjectstring

    EventNotificationRequest

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

    EventNotificationUpdate

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

    EventQuery

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

    PaginatedEventNotificationList

    NameType
    count*requirednumber
    results*requiredArray<EventNotification>

    PaginatedResourceNotificationList

    NameType
    count*requirednumber
    results*requiredArray<ResourceNotification>

    ResourceNotification

    NameTypeDescription
    appIdnull | stringApp id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger.
    id*requiredstring
    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.
    owningUser*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.

    ResourceNotificationRequest

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

    Enums

    DavisEventNameMatch

    ⚠️ Deprecated Use literal values.

    Davis event name must equal or contain the string provided.

    Enum keys

    Contains | Equals

    DavisEventTriggerConfigType

    ⚠️ Deprecated Use literal values.

    Enum keys

    DavisEvent

    DavisProblemTriggerConfigType

    ⚠️ Deprecated Use literal values.

    Enum keys

    DavisProblem

    EntityTagsMatch

    ⚠️ Deprecated Use literal values.

    Event must match all or any of the entity tags.

    Enum keys

    All | Any

    EventQueryTriggerConfigType

    ⚠️ Deprecated Use literal values.

    Enum keys

    Event

    EventType

    ⚠️ Deprecated Use literal values.

    Grail event type.

    Enum keys

    Bizevents | DtSystemEvents | Events | SecurityEvents

    Still have questions?
    Find answers in the Dynatrace Community