Skip to content

Commit f057751

Browse files
authored
Update README.md
1 parent 5ce4d29 commit f057751

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ pip install blackduck
1313
```
1414

1515
```python
16-
from blackduck.HubRestApi import HubInstance
16+
from blackduck import Client
1717
import 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

0 commit comments

Comments
 (0)