Manage AFA notifications

Use the following request methods to manage notifications in the AFA Notification Center.

Note: In previous versions of ASMS, the Notifications Center was called Issues Center, and notifications were called issues.

Note: All of the API requests for managing notifications can only be run by administrators. In a distributed architecture environment, they can only be run on the central manager / master appliance.

Retrieve unresolved notifications

The endpoint retrieves all the unresolved notifications in the AFA Notification Center. This includes both acknowledged and active notifications .

Resource Name:/ms-watchdog/v1/api/issues-center/issues

Request Method: POST

Authentication: Cookie with session ID.

Request URL Parameters:

Element

Type

Description

sizeOptional

Integer

Number of results per page.

The default value is 10.

pageOptional

Integer

Page number to return.

The default value is 0 (the first page).

Note: This element requires a definition for size. Defining this element without size will cause the return to be empty.

sortColumnOptional

String

The column / notification attribute to sort by.

One of the elements of the issueAttributes, issue, or device objects. See IssueAttributes type.

sortDirectionOptional

String

The sort direction. One of the following:

  • DESC (Default)
  • ASC

Request Body:

(Optional) A map of column names and values.

The response will only include notifications which match the specified value(s) for the specified columns.

The column name can be any of the elements of the issueAttributes, issue, or device objects. See IssueAttributes type.

Response:

Element

Type

Description

content

Array

An array of issueAttributes objects. See IssueAttributes type.

Various elements that describe the paging of the notifications .  

See the spring framework for more information.

Request example

https://<ASMS_Server>/ms-watchdog/v1/api/issues-center/issues?size=13&page=0&sortColumn=lastFailure&sortDirection=DESC

{"nodeType":"MASTER","issue.type":"System"}

Response example

{ 
 "content":[ 
  { 
   "id":1,
   "status":"OPEN",
   "lastFailure":"2019-05-01T14:33:40.369",
   "lastSuccess":null,
   "count":15,
   "nodeType":"MASTER",
   "nodeName":"10.20.15.82",
   "issue":{ 
    "type":"System",
    "failureType":"Disk space",
    "description":"Low free disk space on /data",
    "remediation":"- Configure/change the backup configuration for a smaller retention size\n- Delete temporary files.",
    "kbLink":""
    },
    "device":null
   },
   { 
    "id":357,
    "status":"ACKNOWLEDGED",
    "lastFailure":"2019-04-24T08:26:45.264",
  "lastSuccess":"2019-04-21T10:18:19.033",
  "count":818,
  "nodeType":"MASTER",
  "nodeName":"10.20.15.82",
  "issue":{ 
  "type":"System",
  "failureType":"Disk space",
  "description":"Low free disk space",
  "remediation":"- Configure/change the backup configuration for a smaller retention size\n- Delete temporary files",
  "kbLink":""
   },
   "device":null
    },
    { 
    "id":133,
    "status":"ACKNOWLEDGED",
    "lastFailure":"2019-04-24T08:26:45.06",
    "lastSuccess":null,
    "count":1893,
    "nodeType":"MASTER",
    "nodeName":"10.20.15.82",
    "issue":{ 
     "type":"System",
     "failureType":"DFS",
     "description":"Synchronization error",
     "remediation":"Synchronization error on node",
     "kbLink":""
     },
     "device":null
     },
],
"pageable":"INSTANCE",
"last":true,
"totalPages":1,
"totalElements":6,
"sort":{ 
	"sorted":false,
	"unsorted":true,
	"empty":true
},
"first":true,
"numberOfElements":6,
"size":0,
"number":0,
"empty":false
}

Acknowledge notifications

The acknowledge request marks active notifications in the AFA Notification Center as acknowledged. Notifications marked as acknowledged will appear in the list of acknowledged notifications and will no longer appear in the list of active notifications.

Resource Name:/ms-watchdog/v1/api/issues-center/issues/acknowledge

Request Method: POST

Authentication: Cookie with session ID.

Request Body: Any array of notification IDs. To retrieve the notification IDs, see Retrieve unresolved notifications .

Response:

Element

Type

Description

newStatus

String

The new status of the notifications: ACKNOWLEDGED.

updatedIssues Array

An array of notification IDs.

successful Boolean

Whether the request was successful.

Request example

#/ms-watchdog/v1/api/issues-center/issues/acknowledge

[2,4]

Response example

{ 
	"newStatus":"ACKNOWLEDGED",
	"updatedIssues":[ 
		2,
		4
	],
	"successful":true
}

Activate an notifications

The activate request marks acknowledged notifications in the AFA Notification Center as active. Notifications marked as active will appear in the list of active notifications and will no longer appear in the list of acknowledged notifications .

Resource Name:/ms-watchdog/v1/api/issues-center/issues/activate

Request Method: POST

Authentication: Cookie with session ID.

Request Body: Any array of notification IDs. To retrieve the notification IDs, see Retrieve unresolved notifications .

Response:

Element

Type

Description

newStatus

String

The new status of the notifications: OPEN.

updatedIssues Array

An array of notification IDs.

successful Boolean

Whether the request was successful.

Request example

#/ms-watchdog/v1/api/issues-center/issues/activate

[2,4]

Response example

{ 
	"newStatus":"OPEN",
	"updatedIssues":[ 
		2,
		4
	],
	"successful":true
}

Get Notifications Count by Type

Retrieves the number of active unresolved notifications for the specified system or device notification type.

In case of device issues, the count includes only those related to active devices.

Resource name: /v1/api/issues-center/issues/count

Request Method: GET

Request parameters:

Parameter Type Description
type

mandatory

string Notification type. Either "System" or "Device".

cURL Example:

curl -X GET "https://localhost/v1/api/issues-center/issues/count?type=System" -H "Authorization: Bearer {token}"
			

Status codes:

Code Description
200 OK
400 Bad Request

Response parameters:

Parameter Type Description
(unnamed) integer The count of active unresolved notifications.

Response example success 200:

Copy
42                

Response example failure 400:

Copy
"Bad Request"                

Get All Notifications Count

Retrieves the number of notifications for both system and device types. You can filter the results to show either resolved or unresolved notifications.

Resource name: /v1/api/issues-center/issues/countAll

Request Method: GET

Request parameters

Parameter Type Description
includeResolved boolean If true, the response also includes resolved notifications. Default is false (resolved issues are not included in the response).

cURL Example

Copy
curl -X GET "https://localhost/v1/api/issues-center/issues/countAll?includeResolved=false" \
-H "Authorization: Bearer <access_token>"

Status codes

Code Description
200 OK. Successfully retrieved the notification counts.
400 Bad Request. Invalid query parameter provided.

Response parameters

Parameter Type Description
acknowledgedIssues integer The count of acknowledged issues.
deviceIssues integer The count of device-related issues.
resolvedIssues integer The count of resolved issues.
systemIssues integer The count of system-related issues.

Response example success 200

Copy
{
  "acknowledgedIssues": 24,
  "systemIssues": 4,
  "deviceIssues": 20,
  "resolvedIssues": 2
}

Response example failure 400

Copy
{
    "error": "Invalid query parameter provided."
}