Skip to content

Commit a5a738d

Browse files
committed
read_scan_status.py
1 parent 6c904cc commit a5a738d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

examples/read_scan_status.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
'''
2+
Created on Jan 13, 2021
3+
4+
@author: kumykov
5+
'''
6+
from blackduck.HubRestApi import HubInstance
7+
import json
8+
import os
9+
import requests
10+
11+
12+
hub=HubInstance()
13+
14+
batch_size=500
15+
16+
codelocations = hub.get_codelocations(limit=1, offset=1)
17+
total_count = codelocations['totalCount']
18+
19+
status = {"in_progress": 0, "unstarted": 0, "completed": 0, "error": 0, "skipped": 0}
20+
21+
for i in status.keys():
22+
codelocations = hub.get_codelocations_internal(limit=1, offset=0, parameters={"filter": "codeLocationStatus:{}".format(i)})
23+
status[i] = codelocations['totalCount']
24+
25+
print (total_count, status)
26+

0 commit comments

Comments
 (0)