Skip to content

ipr.connection

IMAGE_MAX

IMAGE_MAX = 20  # cannot upload more than 20 images at a time

class IprConnection

IprConnection.request()

Request wrapper to handle adding common headers and logging

def request(self, endpoint: str, method: str = 'GET', **kwargs) -> Dict:

Args

  • endpoint (str): api endpoint, excluding the base uri
  • method (str): the http method. Defaults to 'GET'.

Returns

  • Dict: the json response as a python dict

IprConnection.post()

Convenience method for making post requests

def post(self, uri: str, data: Dict = {}, **kwargs) -> Dict:

Args

  • uri (str)
  • data (Dict)

Returns

  • Dict

IprConnection.set_analyst_comments()

Update report comments to an existing report

def set_analyst_comments(self, report_id: str, data: Dict) -> Dict:

Args

  • report_id (str)
  • data (Dict)

Returns

  • Dict

Todo

Add to main upload. Pending: https://www.bcgsc.ca/jira/browse/DEVSU-1177

IprConnection.post_images()

Post images to the report

def post_images(self, report_id: str, files: Dict[str, str], data: Dict[str, str] = {}) -> None:

Args

  • report_id (str)
  • files (Dict[str, str])
  • data (Dict[str, str])
Back to top