ImpSfListEndpoints

The endpoints list request enables a client application to receive a list of all managed and unmanaged endpoints, with their basic details. This list can then be externally filtered or searched by the application to identify individual endpoints that might require action. For any such endpoint, the application can obtain fuller details (see Endpoint Details Request below) and if relevant change its enrollment status.

python · Imperva Skyfence

Details

IDImpSfListEndpoints
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10116658
TagsImperva Skyfence

README

Enables a clients application to receive a list of all managed and unmanaged endpoints, with their basic details. This list can then be externally filtered or searched by the application to identify individual endpoints that might require action. For any such endpoint, the application can obtain fuller details (see Endpoint Details Request below) and if relevant change its enrollment status.

Script Data


Name Description
Script Type python
Tags Imperva Skyfence

Dependencies


This script uses the following commands and scripts.

  • imp-sf-list-endpoints

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

import demistomock as demisto
from ImpSfListEndpoints import main


def test_list_endpoints_empty(mocker):
    empty_result = [{"Type": 1, "Contents": {}, "ContentsFormat": "json"}]
    mocker.patch.object(demisto, "executeCommand", return_value=empty_result)
    demisto_results_mocker = mocker.patch.object(demisto, "results")
    main()
    assert demisto_results_mocker.called
    assert demisto_results_mocker.call_args.args[0] == "No results."
    assert demisto_results_mocker.call_count == 1


def test_list_endpoints_non_empty(mocker):
    empty_result = [{"Type": 1, "Contents": {"result": [{"last_updated": "1662980143624"}]}, "ContentsFormat": "json"}]
    mocker.patch.object(demisto, "executeCommand", return_value=empty_result)
    demisto_results_mocker = mocker.patch.object(demisto, "results")
    main()
    assert demisto_results_mocker.called
    assert demisto_results_mocker.call_args.args[0].get("ContentsFormat") == "table"
    assert demisto_results_mocker.call_count == 1