Glider
Loading...
Searching...
No Matches
src.upload_module.common.Tools Namespace Reference

Functions

 gen_file_list_drive (final_path)
 
 gen_file_list_event (event, final_path)
 
 send_notification (module, webhook_url, status, files=None, error=None)
 

Constants

 ACCESS_ID
 Access keys for AWS.
 
 ACCESS_KEY
 Access keys for AWS.
 
 s3_client = boto3.client("s3", aws_access_key_id=ACCESS_ID, aws_secret_access_key= ACCESS_KEY)
 Connection for AWS using boto3.
 

Function Documentation

◆ gen_file_list_drive()

src.upload_module.common.Tools.gen_file_list_drive ( final_path)
Receives the final path where files were uploaded and make a list of them.

Args:
    final_path (str): s3 path where files were uploaded
Returns: files (list)

Definition at line 15 of file Tools.py.

◆ gen_file_list_event()

src.upload_module.common.Tools.gen_file_list_event ( event,
final_path )
Checks which files in the input were uploaded successful.

Args:
    event (dict): is a dictionary with all client and files information
    final_path (str): s3 path where files were uploaded
Returns: files_out (list)

Definition at line 34 of file Tools.py.

◆ send_notification()

src.upload_module.common.Tools.send_notification ( module,
webhook_url,
status,
files = None,
error = None )
Sends a success/fail notification to some webhook.

Args:
    module (str): current module
    webhook_url (str): webhook url 
    status (str): final status of execution
    files (list): files uploaded to s3. None when status =! successful
    error (str): error show while procedure fails. None when status = successful
Returns: Nothing

Definition at line 51 of file Tools.py.

Constant Documentation

◆ ACCESS_ID

src.upload_module.common.Tools.ACCESS_ID

Access keys for AWS.

Definition at line 10 of file Tools.py.

◆ ACCESS_KEY

src.upload_module.common.Tools.ACCESS_KEY

Access keys for AWS.

Definition at line 10 of file Tools.py.

◆ s3_client

src.upload_module.common.Tools.s3_client = boto3.client("s3", aws_access_key_id=ACCESS_ID, aws_secret_access_key= ACCESS_KEY)

Connection for AWS using boto3.

Definition at line 13 of file Tools.py.