File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -13,18 +13,18 @@ pip install blackduck
1313```
1414
1515``` python
16- from blackduck.HubRestApi import HubInstance
16+ from blackduck import Client
1717import json
1818
19- username = " sysadmin"
20- password = " your-password"
21- urlbase = " https://ec2-34-201-23-208.compute-1.amazonaws.com"
19+ bd = blackduck.Client(
20+ token = os.environ.get(' blackduck_token' , ' YOUR TOKEN HERE' ),
21+ base_url = ' https://your.blackduck.url' # !important! no trailing slash
22+ # , verify=False # if required
23+ )
2224
23- hub = HubInstance(urlbase, username, password, insecure = True )
25+ for project in bd.get_projects():
26+ print (project.get(' name' )
2427
25- projects = hub.get_projects()
26-
27- print (json.dumps(projects.get(' items' , [])))
2828```
2929
3030# ## Examples
You can’t perform that action at this time.
0 commit comments