4.2.2. Consumer API Wrapper

exception wsapiwrapper.consumer.ConsumerAPIException(message)[source]
__init__(message)[source]

Initialize self. See help(type(self)) for accurate signature.

class wsapiwrapper.consumer.ConsumerApiWrapper(baseurl: str, tokenstr: str = None)[source]
__init__(baseurl: str, tokenstr: str = None)[source]

Constructor for ConsumerApiWrapper

Parameters
  • baseurl (str) – Websensor backend base URL.

  • tokenstr (str) – OAuth access token.

static process_status(status_code: int, desc: str = None)[source]

Raise exception if an HTTP error occurs.

Parameters
Returns

None

exception wsapiwrapper.consumer.Exception400(message='400 Bad input')[source]
__init__(message='400 Bad input')[source]

Initialize self. See help(type(self)) for accurate signature.

exception wsapiwrapper.consumer.Exception401(message='Not authorised to access this resource. Invalid JWT or bad HMAC.')[source]
__init__(message='Not authorised to access this resource. Invalid JWT or bad HMAC.')[source]

Initialize self. See help(type(self)) for accurate signature.

exception wsapiwrapper.consumer.Exception403(message='Forbidden.')[source]
__init__(message='Forbidden.')[source]

Initialize self. See help(type(self)) for accurate signature.

exception wsapiwrapper.consumer.Exception404(message='404 Resource not found')[source]
__init__(message='404 Resource not found')[source]

Initialize self. See help(type(self)) for accurate signature.

exception wsapiwrapper.consumer.Exception409(message='409 Resource already exists')[source]
__init__(message='409 Resource already exists')[source]

Initialize self. See help(type(self)) for accurate signature.