Index

This method allows you to retrieve a list of node scans.

Method URL
GET /api/v2/node_scans.json?node_id=[node_id]

Parameters

Param Type Required Notes
node_id integer Yes ID of the node to retrieve scans for
latest boolean No Retrieve the latest node scan for the node
date_from string No The start date for scans
date_to string No The end date for scans
page integer No Displays results based on specified page number (default 1, 1-indexed).
per_page integer No Number of results per page (defaults to 20 results).

Example Response

Code Status
200 OK

Example Response JSON

[
    {
        "id": 9,
        "node_id": 3,
        "created_at": "2016-08-04T15:03:21-07:00",
        "updated_at": "2016-08-05T15:06:42-07:00",
        "scan_options": "\"scan_ports\":{\"tcp\":\"1-1024\",\"udp\":\"1-1024\"}"
        "url": "https://<hostname>/api/v2/node_scans/9",
    },
    {
        "id": 10,
        "node_id": 3,
        "created_at": "2016-08-05T15:06:37-07:00",
        "updated_at": "2016-08-06T15:07:24-07:00",
        "scan_options": "\"scan_ports\":{\"tcp\":\"1-1024\",\"udp\":\"1-1024\"}"
        "url": "https://<hostname>/api/v2/node_scans/10",
    },
    {
        "id": 11,
        "node_id": 3,
        "created_at": "2016-08-06T15:07:15-07:00",
        "updated_at": "2016-08-07T08:20:00-07:00",
        "scan_options": "\"scan_ports\":{\"tcp\":\"1-1024\",\"udp\":\"1-1024\"}"
        "url": "https://<hostname>/api/v2/node_scans/11",
    }
]

Example Response JSON: Get Latest Node Scan

# GET /api/v2/node_scans.json?node_id=3&latest=true
[
    {
        "id": 11,
        "node_id": 3,
        "created_at": "2016-08-06T15:07:15-07:00",
        "updated_at": "2016-08-07T08:20:00-07:00",
        "scan_options": "\"scan_ports\":{\"tcp\":\"1-1024\",\"udp\":\"1-1024\"}"
        "url": "https://<hostname>/api/v2/node_scans/11",
    }
]

Show

This method allows you to view a node scan referenced by its ID in the request URL path. You may also reference this method from the Index method, as shown in the url key value of each node scan for a specified node.

Method URL
GET /api/v2/node_scans/[node_scan_id].json

Parameters

Param Type Required Notes
node_scan_id integer Yes ID of the node scan to show

Example Response

Code Status
200 OK

Example Response JSON

{
    "id": 4,
    "node_id": 3,
    "data": "...",
    "scan_options": "...",
    "created_at": "2016-08-30T14:38:46-07:00",
    "updated_at": "2016-08-30T14:41:59-07:00",
    "task_id": 6,
    "associated_id": null,
    "category": 0,
    "label": null,
    "tsv": null
}

Compare

This method allows you to compare the differences between that of the specified node_scan_id against another node scan specified by the source id. The differences shown between the two node scans are those of the most current node scan of the source node scan against the node_scan_id.

Method URL
GET /api/v2/node_scans/[node_scan_id]/compare.json?source_id=[source_id]

Parameters

Param Type Required Notes
node_scan_id integer Yes ID of the node scan to be compared with
source_id integer Yes ID of the node scan to be compared against

Example Response

Code Status
200 OK

Example Response JSON: No differences

{
    "__diff_stats": {
        "attr_total": 2722,
        "ci_total": 772
    }
}

Example Resopnse JSON: Differences retrieved

{
    "packages": {
        "windows": {
            "Notepad++": {
                "version": {
                    "__a_value": "6.9.2",
                    "__b_value": "6.9.1",
                    "__diff": "attr_different"
                },
                "__diff_stats": {
                    "attr_different": 1,
                    "attr_total": 2
                }
            }
        }
     },
    "__diff_stats": {
        "attr_different": 2,
        "attr_total": 2884,
        "ci_different": 2,
        "ci_total": 779,
        "attr_b_missing": 162,
        "ci_b_missing": 7
    }
}

This method allows you to search your previous node scans for key words and return a JSON result.

Method URL
GET /api/v2/node_scans/search.json?query=item&[options]

Parameters

Param Type Required Notes
query string Yes The query string you wish to search for
type string No The type name (eg Packages, Users) you wish to restrict the query to
environment_id integer No The id of the environment you wish to restrict the query to
node_group_id int No The id of the node group you wish to restrict the query to
exact_match boolean No Whether or not the results should exactly match the search text

Example Response

Code Status
200 OK

Example Response JSON

{
    "node_id": 6,
    "node_name": "SERVER_XYZ",
    "scan_date": "2014-06-28T21:24:24-07:00",
    "data": {
        "packages": {
        "windows": {
                "Adobe Flash Player 11 ActiveX": {
                "name": "Adobe Flash Player 11 ActiveX",
                "version": "11.3.300.257"
                }
            }
        }
    }
}
Tags: node scans