2022

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

5. Check boxes to receive notifications for events

    1. Started

    2. Completed

    3. Errored

6. There are 2 methods you can use to configure Webhooks:

...

  • This method is used if you want to use your own API to get notified using webhooks

  • From the URL drop-down menu choose the GET method option.

  • URL (supporting variable injection) - notification.webhook.url

  • This method allows parameters in URL

  • Example of a URL for Get method:method 

Method: GET

https://backupreport.hejuba.ch/api.php?computername=CTCSRV20&datetime=$date;

  format =”yyyy-MM-dd’T’hh:mm:ss”$&profile=$profile$&errorCount=$if(isError)$$errorCount$$else$0$endif$&recordProcessed=$recordsProcessed$

 

  • You can format your calls for multiple parameters. 

  • The above example: The user required details such as:

...

  • There is a specific list of supported expressions which has to be followed for writing the various required parameters in the URL while running the GET method.

  • These can be found listed under “Supported Expressions”. Various conditions for these parameters can also be listed. 

  • Once you enter all parameters Click SAVE

POST method

Fig 2: Put Method

  • This method is used if the user wants to define the payload.

  • From the URL drop-down menu choose the POST method option.

  • The following screen will pop-up.

  • Fill all the details : URL, HEADERS, CONTENT TYPE and PAYLOAD

Fig 3: Details to Fill


For example:

Let us consider that a user wants to get notified in SLACK. 

Enter details as follows:

a. URL:

In Slack the screen will appear as below:

POST 

URL: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

b. Content Type:

Content-type:

Content-type: application/json

c. Payload:

Payload: (Freeform)

{

“text” : ” event=$event$ date=$date; format =”yyyy-MM-dd’T’hh:mm:ss”$ ”

}


Fig 4: Screen appearance

  • You can format your calls for multiple parameters. 

  • The above example: The user required details such as:

...

  • Test button - to test the operation of notification

    • For Post, just post the post body as is

  • Phase 1 - we will document the parameters available on Wiki

  • Phase 2 - we will allow them to pick and choose the variables from the UI

  • All the above values captured will be part of properties and will be saved in config.properties

Supported Expressions:

Option

Expression

Notes

Current date

$date; format=”dateformat”$

Format is an optional attribute. However, it is recommended to add one.

Do NOT escape quotes in dateformat as it can lead to errors.

Current event

$event$

Values: Started, Errored or Completed

Error count

$errorCount$

Denotes the number of objects that encountered an error

Is error in backup

$isError$

Values: true if event is errored else false

Profile Name

$profile$


Total records processed

$recordsProcessed$

Total number of records processed ie. inserted + updated for all objects

Using Conditions:

If else conditions are supported, however we need to specify boolean variable from the supported list for conditions:

...