Skip to content

Commit 7088262

Browse files
committed
using latest-scan-summary
1 parent 3db578c commit 7088262

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

examples/client/read_scan_status.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@
3535
status = {"STARTED": 0, "SUCCESS": 0, "FAILURE": 0}
3636
codelocations = bd.get_resource('codeLocations')
3737
for codelocation in codelocations:
38-
latest_summaries = bd.get_resource('scans', codelocation)
39-
for summary in latest_summaries:
40-
scan_state = summary['scanState']
41-
if scan_state in status:
42-
status[scan_state] += 1
43-
else:
44-
status[scan_state] =1
45-
break
38+
latest_scan_summary = bd.get_resource('latest-scan',codelocation, items = False)
39+
scan_state = latest_scan_summary['scanState']
40+
if scan_state in status:
41+
status[scan_state] += 1
42+
else:
43+
status[scan_state] =1
4644

4745
print (status)
4846

0 commit comments

Comments
 (0)