Register a notification (POST)

Description

URL

scheme://domain:port/platform/ws/notifications/register

Description

Registers notifications for a workload.

HTTP Method

POST

Parameters

Name

Description

workloadId

Required. ID of an LSF job or a flow.

Request

Request

Request Information

Method

POST

Request-URI

/platform/ws/notifications/register

Request-Header

Name

Value

Accept

application/xml or application/json

Message-Body

Field format/value

Notes

<NotificationParams>
<AppParam>  
   <id>%s</id> 
   <value>%s</value>
</AppParam>
…
</NotificationParams>
<id>%s</id> defines the parameter name. The possible values are:
  • NOTIFY_ENABLE
  • NOTIFY_EVENTS
  • NOTIFY_CHANNELS
<value>%s</value> defines the value of the parameter. Possible values are:
  • For NOTIFY_ENABLE: Y or N
  • For NOTIFY_EVENTS: Possible values are START, END, SUSPENDED, or EXIT delimited by a comma (no white spaces)
  • For NOTIFY_CHANNELS: Possible values are BROWSER, DESKTOP, MOBILE, or EMAIL delimited by a comma (no white spaces)
Example:
<NotificationParams>
    <AppParam>
        <id>NOTIFY_ENABLE</id>
        <value>Y</value>
    </AppParam>
    <AppParam>
        <id>NOTIFY_EVENTS</id>
        <value>END,EXIT</value>
    </AppParam>
    <AppParam>
        <id>NOTIFY_CHANNELS</id>
        <val-ue>BROWSER,EMAIL</value>
    </AppParam>	
</NotificationParams>

Response

Response Code

  • 200 Successful: Request was successful.
  • 400 Bad Request: The input is not valid.
  • 403 Forbidden: Access restricted by role-based access control permissions.
  • 404 Not Found: The specified workload id was not found.
  • 500 Internal Server Error: Exception occurred

Response-Header

Name

Value

Content-Type

application/xml or application/json

Message-body

Success Message
<Message>
    <message>The workload id %s has been registered for status change notifications.
    </message>
</Message>
Failure Message

If not successful, returns an error message.

For additional information, refer to the schema file ./schemas/jobs/error.xsd.

<error>
  <message>
     %s
  </message>
</error>

Example:

# Request
POST /platform/webservice/notifications/register?workloadId=150 HTTP/1.1
Host: www.example.org
Cookie: platform_token=%s
Content-Type: application/xml
Accept: application/xml

<NotificationParams>
    <AppParam>
        <id>NOTIFY_ENABLE</id>
        <value>Y</value>
    </AppParam>
    <AppParam>
        <id>NOTIFY_EVENTS</id>
        <value>END,EXIT</value>
    </AppParam>
    <AppParam>
        <id>NOTIFY_CHANNELS</id>
        <value>BROWSER,EMAIL</value>
    </AppParam>	
</NotificationParams>

# Response
200 Successful