Spotfire® Server and Environment - Installation and Administration

Configuring an HTTP notification

You can configure HTTP notifications by specifying the HTTP host, selecting which job statuses to notify (all, failed, and successful), and reviewing JSON payload that includes job information.

Before you begin

You must have administrative credentials for Spotfire Server.

About this task

To configure HTTP notifications you will need to use an authentication method based on your requirements. The available options are:

  • Basic Authentication: Uses a username and password.
  • OAuth2: Supports the 'client credentials' grant type.
    Note: For OAuth support, the OAuth2 authentication manager is used. Therefore, it is expected to have an OAuth client registered first using the existing CLI command config-oauth-client.
  • No Authentication: For cases where authentication is not required.

Procedure

  1. Open a command-line interface and export the active configuration by using the export-config command. (For details on using the Spotfire command line, see Executing commands on the command line.)
    config export-config configuration.xml
  2. Run the command config-http-notification to configure the notification service.
  3. Run the command add-notification-preference to add preferences for the source (automation-services or scheduled-updates) and category (all, failed, and successful).
  4. Execute the command import-config to import the configuration file back to the Spotfire database and restart the server.
  5. After the restart, execute the Automation Services job or a scheduled update job.
    Note: If you want to remove preferences for the notification service, use the command line reference remove-notification-preference.

Results

The HTTP notification is sent according to the configured settings.

The HTTP notifier sends JSON payload to the user, containing predefined keys.

Key Description
metadata Contains information about the payload.
version The version of the metadata schema.
data Contains the main details of the payload.
activityLink A URL link to the related activity.
details Additional information about the activity.
epochMillis The activity's timestamp in milliseconds since the Unix epoch.
jobLink A URL link to the associated job.
Note: Only for Automation Service jobs.
libItemId A unique identifier for the related library item.
name The name of the Automation Services job or Scheduled Updates rule.
routingRuleId A unique identifier for the associated Automation Services job/Scheduled Updates rule.
ruleLink A URL link to the associated rule.
Note: Only for Scheduled Updates rules.
source The source of the notification. Possible values are "Scheduled Updates" and "Automation Services".
status The status of the associated activity. Possible values are "SUCCESSFUL", "FAILED", and "CANCELLED".
time The timestamp of the activity in ISO 8601 format, expressed in UTC.
labels Contains labels related to the payload. This field is optional and appears only if configured.

Below is an example of a JSON payload for an Automation Service job.

{
  "metadata": {
    "version": 1
  },
  "data": {
    "jobLink": "http://my_spotfire_server:8080/spotfire/ui/automationServices/edit?action=edit&id=1365f6d8-1156-403a-877b-edb76076cb5e",
    "libItemId": "0278ebf8-225a-4a99-935d-cb2f9ff9c3a7",
    "name": "AutomationServiceJobName",
    "activityLink": "http://my_spotfire_server:8080/spotfire/ui/automationServices/jobActivity?libraryItemId=0278ebf8-225a-4a99-935d-cb2f9ff9c3a7",
    "details": "Execution time: 00:00:20",
    "source": "Automation Services",
    "epochMillis": 1726137021073,
    "time": "2024-09-12T10:30Z",
    "routingRuleId": "1365f6d8-1156-403a-877b-edb76076cb5e",
    "status": "SUCCESSFUL"
  },
  "labels": {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
  }
}

Below is an example of a JSON payload for a Scheduled Updates job:

{
  "metadata": {
    "version": 1
  },
  "data": {
    "libItemId": "ab4989ab-9790-4a62-8258-037efa0920a3",
    "activityLink": "http://my_spotfire_server:8080/spotfire/ui/schedulingRouting/activity?ruleId=75f1f101-2d90-49aa-874c-664fa935c004",
    "name": "ScheduledUpdatesJobName",
    "details": "Unload",
    "source": "Scheduled Updates",
    "ruleLink": "http://my_spotfire_server:8080/spotfire/ui/schedulingRouting/rules/edit/75f1f101-2d90-49aa-874c-664fa935c004",
    "epochMillis": 1723376534723,
    "time": "2024-08-11T11:42Z",
    "routingRuleId": "75f1f101-2d90-49aa-874c-664fa935c004",
    "status": "SUCCESSFUL"
  },
  "labels": {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
  }
}