Skip to content

Commit

Permalink
Adding ID search to tools
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronweaver committed Feb 6, 2018
1 parent 6a61c0d commit 6942698
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ config/config.json

test.py
.DS_Store
temp
2 changes: 1 addition & 1 deletion defectdojo_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.7'
__version__ = '1.0.8'
13 changes: 11 additions & 2 deletions defectdojo_api/defectdojo.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ def get_container(self, container_id, limit=20):

###### Tool API #######

def list_tool_types(self, name=None, limit=20):
def list_tool_types(self, id=None, name=None, limit=20):
"""Retrieves all the tool types.
:param name_contains: Search by tool type name.
Expand All @@ -824,12 +824,15 @@ def list_tool_types(self, name=None, limit=20):
if limit:
params['limit'] = limit

if id:
params['id'] = id

if name:
params['name__contains'] = name

return self._request('GET', 'tool_types/', params)

def list_tools(self, name=None, tool_type_id=None, url=None, limit=20):
def list_tools(self, id=None, name=None, tool_type_id=None, url=None, limit=20):
"""Retrieves all the tool configurations.
:param name_contains: Search by tool name.
Expand All @@ -843,6 +846,9 @@ def list_tools(self, name=None, tool_type_id=None, url=None, limit=20):
if limit:
params['limit'] = limit

if id:
params['id'] = id

if name:
params['name'] = name

Expand Down Expand Up @@ -871,6 +877,9 @@ def list_tool_products(self, url=None, name=None, tool_configuration_id=None,
if limit:
params['limit'] = limit

if id:
params['id'] = id

if name:
params['name'] = name

Expand Down

0 comments on commit 6942698

Please sign in to comment.