From 69426986db4105a403a028d90525d55d938de611 Mon Sep 17 00:00:00 2001 From: Aaron Weaver <aaronweaver@users.noreply.github.com> Date: Tue, 6 Feb 2018 12:05:52 -0500 Subject: [PATCH] Adding ID search to tools --- .gitignore | 1 + defectdojo_api/__init__.py | 2 +- defectdojo_api/defectdojo.py | 13 +++++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 957e777..ab22a69 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,4 @@ config/config.json test.py .DS_Store +temp diff --git a/defectdojo_api/__init__.py b/defectdojo_api/__init__.py index 887a342..52e9a85 100644 --- a/defectdojo_api/__init__.py +++ b/defectdojo_api/__init__.py @@ -1 +1 @@ -__version__ = '1.0.7' +__version__ = '1.0.8' diff --git a/defectdojo_api/defectdojo.py b/defectdojo_api/defectdojo.py index 9434f1e..72641d7 100644 --- a/defectdojo_api/defectdojo.py +++ b/defectdojo_api/defectdojo.py @@ -812,7 +812,7 @@ class DefectDojoAPI(object): ###### 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. @@ -824,12 +824,15 @@ class DefectDojoAPI(object): 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. @@ -843,6 +846,9 @@ class DefectDojoAPI(object): if limit: params['limit'] = limit + if id: + params['id'] = id + if name: params['name'] = name @@ -871,6 +877,9 @@ class DefectDojoAPI(object): if limit: params['limit'] = limit + if id: + params['id'] = id + if name: params['name'] = name -- GitLab