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
13
13
```
14
14
15
15
``` python
16
- from blackduck.HubRestApi import HubInstance
16
+ from blackduck import Client
17
17
import json
18
18
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
+ )
22
24
23
- hub = HubInstance(urlbase, username, password, insecure = True )
25
+ for project in bd.get_projects():
26
+ print (project.get(' name' )
24
27
25
- projects = hub.get_projects()
26
-
27
- print (json.dumps(projects.get(' items' , [])))
28
28
```
29
29
30
30
# ## Examples
You can’t perform that action at this time.
0 commit comments