1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-25 21:39:13 +02:00
2022-11-15 09:34:07 +01:00

1.5 KiB

${docGenStepName}

${docGenDescription}

The SAP Alert Notification service for SAP BTP allows users to define certain delivery channels, for example, e-mail or triggering of HTTP requests, to receive notifications from pipeline events.

Prerequisites

A service-key credential from the alert notification service.

${docGenParameters}

${docGenConfiguration}

${docJenkinsPluginDependencies}

Example

Example configuration for the use in a Jenkinsfile.

ansSendEvent(
  script: this,
  ansServiceKeyCredentialsId: "myANSCredential",
  eventType: "errorEvent",
  severity: "ERROR",
  category: "EXCEPTION",
  subject: "Something went wrong",
  body: "The details of what went wrong",
  priority: 3,
  tags: [
    myTag: "myValue",
    yourTag: "yourValue"
  ],
  resourceName: "Test Pipeline",
  resourceType: "My Pipeline",
  resourceInstance: "myPipeline",
  resourceTags: [
    myResourceTag: "a value"
  ]
)

Example for the use in a YAML configuration file (such as .pipeline/config.yaml).

steps:
  <...>
  ansSendEvent:
    ansServiceKeyCredentialsId: "myANSCredential",
    eventType: "errorEvent",
    severity: "ERROR",
    category: "EXCEPTION",
    subject: "Something went wrong",
    body: "The details of what went wrong",
    priority: 3,
    tags:
      myTag: "myValue",
      yourTag: "yourValue",
    resourceName: "Test Pipeline",
    resourceType: "My Pipeline",
    resourceInstance: "myPipeline",
    resourceTags:
      myResourceTag: "a value"