(Click to open topic with navigation)
This section describes behavior of the Notifications object in Moab Web Services. It contains the URLs, request bodies, and responses delivered to and from MWS.
The Notifications API is new with API version 3, and is not available with older API versions. The supported methods table below requires each resource to be accessed with a URL parameter of api-version=3.
For more information, see Requesting Specific API Versions.
The Fields: Notifications reference contains the type and description of all fields in the Notifications object.
Supported methods
Resource | GET | PUT | POST | DELETE |
---|---|---|---|---|
/rest/notifications/ | Get All Notifications | -- | -- | -- |
/rest/notifications/<id> | Get Single Notification | -- | -- | -- |
/rest/notifications/ignore | -- | Ignore All Notifications | -- | -- |
/rest/notifications/<id>/ignore | -- | Ignore Single Notification | -- | -- |
/rest/notifications/unignore | -- | Unignore All Notifications | -- | -- |
/rest/notifications/<id>/unignore | -- | Unignore Single Notification | -- | -- |
/rest/notifications/dismiss | -- | Dismiss All Notifications | -- | -- |
/rest/notifications/<id>/dismiss | -- | Dismiss Single Notification | -- | -- |
This topic contains these sections:
The HTTP GET method is used to retrieve Notification information.
Quick reference
GET http://localhost:8080/mws/rest/notifications?api-version=3 GET http://localhost:8080/mws/rest/notifications/<id>?api-version=3
5.241.1.A Get All Notifications
URLs and parameters
GET http://localhost:8080/mws/rest/notifications?api-version=3[&proxy-user=<username>][&query={"ignoredDate":null,"dismissedDate":null}][&sort={"observedDate":-1}]
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
proxy-user | No | String |
Perform the action as this user. Notifications cannot be created directly. Instead, they are automatically created for the current user or proxy-user specified in the request from non-expired notification conditions (see Notification Conditions). This is true no matter the query specified. |
-- |
query | No | JSON |
Query for specific results. It is possible to query notifications by one or more fields based on MongoDB query syntax. However, typically you will want to query on {"ignoredDate":null,"dismissedDate":null}. |
query={"ignoredDate":null,"dismissedDate":null} |
sort | No | JSON | Sort the results. Use 1 for ascending and -1 for descending. | sort={"observedDate":-1} |
See Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/notifications?api-version=3&proxy-user=<username>&query={"ignoredDate":null,"dismissedDate":null}][&sort={"observedDate":-1} ------------------------------------ { "totalCount": 2, "resultCount": 2, "results": [ { "conditionId": "521bdea1e4b019cd33e29c86", "createdDate": "2013-08-26 23:02:56 UTC", "details": {}, "dismissedDate": null, "ignoredDate": null, "message": "A health check failed for the 'ZeroMQ Message Queue' connection, please see the MWS health details page for more information.", "objectId": "zmq", "objectType": "Health", "observedDate": "2013-09-05 17:57:00 UTC", "origin": "MWS/HealthNotificationJob", "user": "admin", "id": "5230ed82e4b065347016d62f" }, { "conditionId": "521a1f18e4b0e3f9031f47f5", "createdDate": "2013-08-25 15:13:28 UTC", "details": {}, "dismissedDate": null, "ignoredDate": null, "message": "A health check failed for the 'LDAP' connection, please see the MWS health details page for more information.", "objectId": "ldap", "objectType": "Health", "observedDate": "2013-08-30 18:11:15 UTC", "origin": "MWS/HealthNotificationJob", "user": "admin", "id": "5230ed82e4b065347016d60d" } ] }
5.241.1.B Get Single Notification
URLs and parameters
GET http://localhost:8080/mws/rest/notifications/<id>?api-version=3
Parameter | Required | Type | Description |
---|---|---|---|
id | Yes | String | The unique identifier of the object. |
See Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/notifications/5230ed82e4b065347016d60d?api-version=3
------------------------------------
{
"conditionId": "521a1f18e4b0e3f9031f47f5",
"createdDate": "2013-08-25 15:13:28 UTC",
"details": {},
"dismissedDate": null,
"ignoredDate": null,
"message": "A health check failed for the 'LDAP' connection, please see the MWS health details page for more information.",
"objectId": "ldap",
"objectType": "Health",
"observedDate": "2013-08-30 18:11:15 UTC",
"origin": "MWS/HealthNotificationJob",
"user": "admin",
"id": "5230ed82e4b065347016d60d"
}
5.241.2 Ignoring Notifications
The HTTP PUT method is used to ignore Notifications.
Quick reference
PUT http://localhost:8080/mws/rest/notifications/ignore?api-version=3 PUT http://localhost:8080/mws/rest/notifications/<id>/ignore?api-version=3
5.241.2.A Ignore All Notifications
URLs and parameters
PUT http://localhost:8080/mws/rest/notifications/ignore?api-version=3
See Global URL Parameters for available URL parameters.
Sample response
JSON response ------------------------------------ {"messages":["Updated 10 Notification objects"]}
5.241.2.B Ignore Single Notification
URLs and parameters
PUT http://localhost:8080/mws/rest/notifications/5230ed82e4b065347016d60d/ignore?api-version=3
Parameter | Required | Type | Description |
---|---|---|---|
id | Yes | String | The unique identifier of the object. |
See Global URL Parameters for available URL parameters.
Sample response
PUT http://localhost:8080/mws/rest/notifications/5230ed82e4b065347016d60d/ignore?api-version=3
------------------------------------
{
"conditionId": "521a1f18e4b0e3f9031f47f5",
"createdDate": "2013-08-25 15:13:28 UTC",
"details": {},
"dismissedDate": null,
"ignoredDate": "2013-09-17 15:34:36 UTC",
"message": "A health check failed for the 'LDAP' connection, please see the MWS health details page for more information.",
"objectId": "ldap",
"objectType": "Health",
"observedDate": "2013-08-30 18:11:15 UTC",
"origin": "MWS/HealthNotificationJob",
"user": "admin",
"id": "5230ed82e4b065347016d60d"
}
5.241.3 Unignoring Notifications
The HTTP PUT method is used to unignore Notifications.
Quick reference
PUT http://localhost:8080/mws/rest/notifications/unignore?api-version=3 PUT http://localhost:8080/mws/rest/notifications/<id>/unignore?api-version=3
5.241.3.A Unignore All Notifications
URLs and parameters
PUT http://localhost:8080/mws/rest/notifications/unignore?api-version=3
See Global URL Parameters for available URL parameters.
Sample response
JSON response ------------------------------------ {"messages":["Updated 10 Notification objects"]}
5.241.3.B Unignore Single Notification
PUT http://localhost:8080/mws/rest/notifications/5230ed82e4b065347016d60d/unignore?api-version=3
Parameter | Required | Type | Description |
---|---|---|---|
id | Yes | String | The unique identifier of the object. |
See Global URL Parameters for available URL parameters.
Sample response
PUT http://localhost:8080/mws/rest/notifications/5230ed82e4b065347016d60d/unignore?api-version=3
------------------------------------
{
"conditionId": "521a1f18e4b0e3f9031f47f5",
"createdDate": "2013-08-25 15:13:28 UTC",
"details": {},
"dismissedDate": "null",
"ignoredDate": null,
"message": "A health check failed for the 'LDAP' connection, please see the MWS health details page for more information.",
"objectId": "ldap",
"objectType": "Health",
"observedDate": "2013-08-30 18:11:15 UTC",
"origin": "MWS/HealthNotificationJob",
"user": "admin",
"id": "5230ed82e4b065347016d60d"
}
5.241.4 Dismissing Notifications
The HTTP PUT method is used to dismiss Notifications.
Quick reference
PUT http://localhost:8080/mws/rest/notifications/dismiss?api-version=3 PUT http://localhost:8080/mws/rest/notifications/<id>/dismiss?api-version=3
5.241.4.A Dismiss All Notifications
URLs and parameters
PUT http://localhost:8080/mws/rest/notifications/dismiss?api-version=3
See Global URL Parameters for available URL parameters.
Sample response
JSON response ------------------------------------ {"messages":["Updated 10 Notification objects"]}
5.241.4.B Dismiss Single Notification
URLs and parameters
PUT http://localhost:8080/mws/rest/notifications/5230ed82e4b065347016d60d/dismiss?api-version=3
Parameter | Required | Type | Description |
---|---|---|---|
id | Yes | String | The unique identifier of the object. |
See Global URL Parameters for available URL parameters.
Sample response
PUT http://localhost:8080/mws/rest/notifications/5230ed82e4b065347016d60d/dismiss?api-version=3
------------------------------------
{
"conditionId": "521a1f18e4b0e3f9031f47f5",
"createdDate": "2013-08-25 15:13:28 UTC",
"details": {},
"dismissedDate": "2013-09-17 15:34:36 UTC",
"ignoredDate": null,
"message": "A health check failed for the 'LDAP' connection, please see the MWS health details page for more information.",
"objectId": "ldap",
"objectType": "Health",
"observedDate": "2013-08-30 18:11:15 UTC",
"origin": "MWS/HealthNotificationJob",
"user": "admin",
"id": "5230ed82e4b065347016d60d"
}
Related Topics