Skip to content

Client versus HubInstance Comparison

Sumio Kiyooka edited this page Apr 19, 2021 · 11 revisions
Item Client HubInstance
History Designed from the ground up in 2020 to address specific systemic problems Developed organically since 2018
Files Client.py, Authentication.py HubRestApi.py and all the other blackduck/*.py files
Endpoint methods No endpoint specific methods provided Plethora of methods for many endpoints
requests.session Uses a single underlying session. Connection pooling provides a significant performance benefit. No session used, new connection established every request
requests Encourages direct access to the Requests library's session.get(), put(), post(), and delete() methods and passes along **kwargs. Requires custom execute_get(), execute_put()/post() and execute_delete() methods. Does not allow **kwargs.
timeout Supported Not supported
retries Supported Not supported
TLS certificate verification Set once, persisted Same
Bearer token Automatically renewed before expiry No renewal
Base URL Set once and automatically prepended to every request Must provide with every request
Resources Discover and traverse _meta, links, with list_resources() and get_resource() Up to user to manually traverse
Pagination Supported with get_resource(name, items=True) and get_items() and backed by a generator Up to user to handle
Media type headers Defaults provided 'accept', 'content-type' = "application/json", up to user to specify Defaults provided, many 'accept' / 'content-type' headers hard-coded for specific endpoint methods