@@ -668,15 +668,43 @@ def upload_scan(self, engagement_id, scan_type, file, active, scan_date, tags=No
668668 files = data
669669 )
670670
671+ ##### Re-upload API #####
672+
673+ def reupload_scan (self , test_id , scan_type , file , active , scan_date , tags = None , build = None ):
674+ """Re-uploads and processes a scan file.
675+
676+ :param test_id: Test identifier.
677+ :param file: Path to the scan file to be uploaded.
678+
679+ """
680+ if tags is None :
681+ tags = ''
682+
683+ if build is None :
684+ build = ''
685+
686+ data = {
687+ 'test' : ('' , self .get_test_uri (test_id )),
688+ 'file' : open (file , 'rb' ),
689+ 'scan_type' : ('' , scan_type ),
690+ 'active' : ('' , active ),
691+ 'scan_date' : ('' , scan_date ),
692+ 'tags' : ('' , tags ),
693+ 'build_id' : ('' , build )
694+ }
695+
696+ return self ._request (
697+ 'POST' , 'reimportscan/' ,
698+ files = data
699+ )
700+
671701 ##### Credential API #####
672702
673703 def list_credentials (self , name = None , username = None , limit = 20 ):
674704 """Retrieves all the globally configured credentials.
675-
676705 :param name_contains: Search by credential name.
677706 :param username: Search by username
678707 :param limit: Number of records to return.
679-
680708 """
681709
682710 params = {}
@@ -697,7 +725,7 @@ def get_credential(self, cred_id, limit=20):
697725 :param credential_id: Credential identification.
698726 """
699727 return self ._request ('GET' , 'credentials/' + str (cred_id ) + '/' )
700-
728+
701729 ##### Credential Mapping API #####
702730
703731 def list_credential_mappings (self , name = None , product_id_in = None , engagement_id_in = None , test_id_in = None , finding_id_in = None , limit = 20 ):
0 commit comments