@@ -264,14 +264,14 @@ def upload_sample_from_file(self, file_source, custom_filename=None, archive_pas
264
264
265
265
return response
266
266
267
- def upload_sample_from_url (self , file_url , crawler = None , archive_password = None , rl_cloud_sandbox_platform = None ):
268
- """Accepts a file url and returns a response .
267
+ def submit_url_for_analysis (self , url_string , crawler = None , archive_password = None , rl_cloud_sandbox_platform = None ):
268
+ """Sends a URL for analysis on A1000 .
269
269
Additional parameters can be provided.
270
- :param file_url : URL from which the appliance should download the data
271
- :type file_url : str
270
+ :param url_string : URL to analyze
271
+ :type url_string : str
272
272
:param crawler: crawler method (local or cloud)
273
273
:type crawler: str
274
- :param archive_password: password, if file is a password-protected archive
274
+ :param archive_password: password, if it is a password-protected archive
275
275
:type archive_password: str
276
276
:param rl_cloud_sandbox_platform: Cloud Sandbox platform (windows7, windows10 or macos_11)
277
277
:type rl_cloud_sandbox_platform: str
@@ -283,7 +283,7 @@ def upload_sample_from_url(self, file_url, crawler=None, archive_password=None,
283
283
crawler = crawler ,
284
284
archive_password = archive_password ,
285
285
rl_cloud_sandbox_platform = rl_cloud_sandbox_platform ,
286
- file_url = file_url
286
+ url_string = url_string
287
287
)
288
288
289
289
url = self ._url .format (endpoint = self .__UPLOAD_ENDPOINT )
@@ -381,30 +381,30 @@ def get_submitted_url_report(self, task_id, retry):
381
381
raise RequestTimeoutError ("Report fetching attempts finished - The analysis report is still not ready "
382
382
"or the sample does not exist on the appliance." )
383
383
384
- def upload_sample_from_url_and_get_report (self , file_url , retry = True , crawler = "local" , archive_password = None ,
385
- rl_cloud_sandbox_platform = None ):
386
- """Accepts a file url for file upload and returns a report response .
387
- This method combines uploading a sample from url and obtaining the summary analysis report.
384
+ def submit_url_for_analysis_and_get_report (self , url_string , retry = True , crawler = "local" , archive_password = None ,
385
+ rl_cloud_sandbox_platform = None ):
386
+ """Sends a URL for analysis on A1000 .
387
+ This method combines submitting a URL for analysis and obtaining the summary analysis report.
388
388
Additional fields can be provided.
389
389
The result fetching action of this method utilizes the set number of retries and wait time in seconds to time
390
390
out if the analysis results are not ready.
391
- :param file_url : URL from which the appliance should download the data
392
- :type file_url : str
391
+ :param url_string : URL to analyze
392
+ :type url_string : str
393
393
:param retry: if set to False there will only be one try at obtaining the analysis report
394
394
:type retry: bool
395
395
:param crawler: crawler method (local or cloud)
396
396
:type crawler: string
397
- :param archive_password: password, if file is a password-protected archive
397
+ :param archive_password: password, if it is a password-protected archive
398
398
:type archive_password: str
399
399
:param rl_cloud_sandbox_platform: Cloud Sandbox platform (windows7, windows10 or macos_11)
400
400
:type rl_cloud_sandbox_platform: str
401
401
:return: :class:`Response <Response>` object
402
402
:rtype: requests.Response
403
403
"""
404
404
405
- upload_response = self .upload_sample_from_url ( file_url = file_url , crawler = crawler ,
406
- archive_password = archive_password ,
407
- rl_cloud_sandbox_platform = rl_cloud_sandbox_platform )
405
+ upload_response = self .submit_url_for_analysis ( url_string = url_string , crawler = crawler ,
406
+ archive_password = archive_password ,
407
+ rl_cloud_sandbox_platform = rl_cloud_sandbox_platform )
408
408
409
409
response_detail = upload_response .json ().get ("detail" )
410
410
task_id = response_detail .get ("id" )
@@ -2287,15 +2287,15 @@ def __get_token(self, username, password):
2287
2287
return token
2288
2288
2289
2289
@staticmethod
2290
- def __create_post_payload (custom_filename = None , file_url = None , crawler = None , archive_password = None ,
2290
+ def __create_post_payload (custom_filename = None , url_string = None , crawler = None , archive_password = None ,
2291
2291
rl_cloud_sandbox_platform = None , tags = None , comment = None , cloud_analysis = True ,
2292
2292
classification = None , risk_score = None , threat_platform = None , threat_type = None ,
2293
2293
threat_name = None , name = None , content = None , publish = None , ticloud = None ):
2294
2294
"""Accepts optional fields and returns a formed dictionary of those fields.
2295
2295
:param custom_filename: custom file name for upload
2296
2296
:type custom_filename: str
2297
- :param file_url : URL from which the appliance should download the data
2298
- :type file_url : str
2297
+ :param url_string : URL from which the appliance should download the data
2298
+ :type url_string : str
2299
2299
:param crawler: crawler method (local or cloud)
2300
2300
:type crawler: str
2301
2301
:param archive_password: password, if file is a password-protected archive
@@ -2340,10 +2340,10 @@ def __create_post_payload(custom_filename=None, file_url=None, crawler=None, ar
2340
2340
if tags and not isinstance (tags , str ):
2341
2341
raise WrongInputError ("tags parameter must be string." )
2342
2342
2343
- if file_url :
2344
- if not isinstance (file_url , str ):
2343
+ if url_string :
2344
+ if not isinstance (url_string , str ):
2345
2345
raise WrongInputError ("file_url parameter must be string." )
2346
- if not file_url .startswith (("http://" , "https://" )):
2346
+ if not url_string .startswith (("http://" , "https://" )):
2347
2347
raise WrongInputError ("Supported file_url protocols are HTTP and HTTPS." )
2348
2348
2349
2349
if crawler and crawler not in ("cloud" , "local" ):
@@ -2417,8 +2417,8 @@ def __create_post_payload(custom_filename=None, file_url=None, crawler=None, ar
2417
2417
if cloud_analysis :
2418
2418
data ["analysis" ] = "cloud"
2419
2419
2420
- if file_url :
2421
- data ["url" ] = file_url
2420
+ if url_string :
2421
+ data ["url" ] = url_string
2422
2422
2423
2423
if classification :
2424
2424
data ['classification' ] = classification
0 commit comments