Skip to content

Commit 57e2f2b

Browse files
committed
finished batch api
1 parent 4c6fd58 commit 57e2f2b

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

ThreadFixProApi/Networks/_utils/_batch.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,22 @@ def __init__(self, host, api_key, verify_ssl, timeout, headers, user_agent, cert
2121
the private key and the certificate) or as a tuple of both file’s path
2222
:param debug: Prints requests and responses, useful for debugging.
2323
"""
24-
super().__init__(host, api_key, verify_ssl, timeout, headers, user_agent, cert, debug)
24+
super().__init__(host, api_key, verify_ssl, timeout, headers, user_agent, cert, debug)
25+
26+
def bulk_update_vulnerability_status(self, status, vuln_ids):
27+
"""
28+
Updates a group of vulnerabilities at once to a new status
29+
:param status: Vulnerability status to update to
30+
:param vuln_ids: Vulnerabilities to update
31+
"""
32+
params = { 'resources' : vuln_ids}
33+
return super().request('PUT', f'/api/batch/vulnerabilities/status/{status}', params=params)
34+
35+
def bulk_update_vulnerability_severity(self, severity, vuln_ids):
36+
"""
37+
Updates a group of vulnerabilities at once to a new severity
38+
:param severity: Vulnerability severity to update to
39+
:param vuln_ids: Vulnerabilities to update
40+
"""
41+
params = { 'resources' : vuln_ids}
42+
return super().request('PUT', f'/api/batch/vulnerabilities/severity/{severity}', params=params)

0 commit comments

Comments
 (0)