Retrieve an analysis status

AFA's REST API enables you to retrieve the status of a specific analysis, or the statuses of all analyses currently running.

Get all current analysis statuses

The status request retrieves the statuses of all analysis processes currently running in AFA.

This request has no parameters, but only responds with data about current analyses if an analysis is actually running. If no analysis is running, the response returns null.

Resource Name:

/api/v1/analyzeTask/status

Request Method: GET

Response:

If one or more analysis processes are currently running in AFA, the response will include the following data for each analysis:

reportID The name of the report currently being generated
deviceName The name of the device on which the analysis is running
status

The current analysis status. One of the following:

  • COLLECTING_DATA
  • QUEUED
  • INIT
  • RUNNING
updatedDate

The date and time the analysis status was last updated, in Unix epoch time format.

Note: If no analysis is currently running in AFA, the response is empty.

Request example

curl -X GET "https://<AFA server IP>/afa/api/v1/analyzeTask/status" -H "accept: */*"

Response example

[

{

"reportId": "afa-5276",

"deviceName": "Poppy",

"status": "INIT",

"updatedDate": 1581515387753

},

{

"reportId": "afa-5289",

"deviceName": "Rose",

"status": "INIT",

"updatedDate": 1581515392769

},

{

"reportId": "afa-5291",

"deviceName": "Daffodil",

"status": "INIT",

"updatedDate": 1581515399219

},

{

"reportId": "afa-5288",

"deviceName": "Buttercup",

"status": "INIT",

"updatedDate": 1581515390297

},

{

"reportId": "afa-5290",

"deviceName": "Lily",

"status": "INIT",

"updatedDate": 1581515394252

}

]

Get status of a specific analysis

The get_analysis_status request retrieves the current status of an analysis.

The input will be the active session ID and the device, group or matrix display name. The output will indicate the status of the analysis.

Resource Name:

/api/v1/analysis/status

Request Method: GET

Request URL Parameters:

Element

Type

Description

session

Mandatory

String

Session ID returned in login request.

entity

Mandatory

String

The display name of the device, group, or matrix.

entityType

Optional

String

One of the following:

  • device (default)
  • group
  • matrix

Response:

Element

Type

Description

reportStatus

String

The status of the analysis. One of the following:

  • FAILED
  • COMPLETED
  • RUNNING
status

String

One of the following:

  • true. Indicates the request succeeded.
  • false. Indicates the request failed.

message

Returned only if the request fails.

String

An error message.

Request example

curl -H "Accept:application/json" -k 'https://<AFA server IP address>/fa/server/analysis/status?entity=fw1&entityType=device&session=f87381213f579c424370e9c21c709e40'

Response example

{   "status": true,   "reportStatus": "FAILED"}