src.api.catacloud.caclsession

Classes

CaClSession([token, url])

class src.api.catacloud.caclsession.CaClSession(token=None, url=None)
Author:

Alberto M. Esmoris Pena

Class representing a session to use the Catacloud API.

Variables:
  • token (str) – The string representing the token for the session.

  • url (str) – The string representing the API’s URL.

__init__(token=None, url=None)

Instantiate a Catacloud API session with given token.

Parameters:
  • token (str or None) – The token for the session. If it is None, then it is taken automatically from the configuration.

  • url (str or None) – The API’s URL. If it is None, then it is taken automatically from the configuration.

craft_header(header=None)

Craft a header for an HTTP request that needs to use this session.

Parameters:

header (dict or None) – The header to be crafted. If None, an empty header is initialized from scratch.

Returns:

The crafted header.