API Services

This is the documentation for the methods in the module api_service

Generate unique job id and S3 tokens for each job.

lambda_services.api_service.api_service.apbs_logger()[source]

Get a singleton logger for all code.

Returns

An all encompassing logger.

Return type

Logger

lambda_services.api_service.api_service.create_s3_url(bucket_name: str, job_tag: str, file_name: str) str[source]

Create an URL that will allow a file to be stored on an S3 bucket.

Parameters
  • str (file_name) – AWS S3 bucket to store file in

  • str – the directory in the bucket_name

  • str – the filename to put under the job_tag directory

Returns

A URL that can be used to upload a file to the S3 bucket

Return type

url (str)

lambda_services.api_service.api_service.generate_id_and_tokens(event: dict, context) dict[source]

Generate an unique job id and S3 auth tokens.

Parameters
  • event (dict) – A dictionary of terms.

  • context – Required by AWS Lambda

Returns

A dictionary of URLs and filenames

Return type

URLs (dict)