Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa12522

Browse files
authored
Merge pull request cylance#13 from joedelsol/hotfix-examples
Example script cleanup
2 parents 2862b56 + 4f2b2dd commit fa12522

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

examples/find_stale_devices.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Simple example to read creds file, connect to API, and print detections.
1+
# Simple example to read creds file, connect to API, and print stale devices.
2+
# Use the --days argument to specify stale day amount, other than the default 30.
23
from __future__ import print_function
34

45
import argparse

examples/safelist_trusted_local.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Simple example to read creds file, connect to API, and print detections.
1+
# Simple example to read creds file, connect to API, and print Trusted Local
2+
# threats found in your environment.
3+
# Using the --Force argument will add these threats to your Global Safe List
24

35
from __future__ import print_function
46
import json

examples/simple_setup.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ def ParseArgs():
6161
exit(-1)
6262

6363
API.create_conn()
64-
detections = API.get_detections()
6564

66-
pprint(detections)
65+
devices = API.get_devices()
66+
for d in devices.data:
67+
zones = API.get_device_zones(d.get("id"))
68+
if not zones.data:
69+
print(f"DEVICE: {d.get('name')}")
70+
print("No Zone Attached")
71+
72+
#zoneDevices = API.get_device_zones()
73+
#pprint(zonesDevices.data)
74+
75+
#detections = API.get_detections()
76+
#pprint(detections.data)

0 commit comments

Comments
 (0)