aihwkit.cloud.client.session module¶
Session handler for the AIHW Composer API.
-
class
aihwkit.cloud.client.session.ApiSession(api_url, api_token, verify=True)[source]¶ Bases:
requests.sessions.SessionSession handler for requests to the AIHW Composer API.
Custom
Sessionfor interfacing with the AIHW Composer API, using:authorization based on jwt token.
custom user agent for the requests.
Additionally, this class stores information about the API URL and base token.
-
request(method, url, *args, **kwargs)[source]¶ Construct a Request, prepares it and sends it.
- Parameters
method (str) – method for the new
Requestobject.url (Union[str, bytes]) – URL for the new
Requestobject.args (Any) – additional arguments for the original
requestsmethod.kwargs (Any) – additional arguments for the original
requestsmethod.
- Returns
A new
Responseobject.- Raises
ApiResponseError – if the response did not have a valid status code.
- Return type
Any
-
class
aihwkit.cloud.client.session.ObjectStorageSession[source]¶ Bases:
requests.sessions.SessionSession handler for requests to object storage.
-
request(method, url, *args, **kwargs)[source]¶ Construct a Request, prepares it and sends it.
- Parameters
method (str) – method for the new
Requestobject.url (Union[str, bytes]) – URL for the new
Requestobject.args (Any) – additional arguments for the original
requestsmethod.kwargs (Any) – additional arguments for the original
requestsmethod.
- Returns
A new
Responseobject.- Raises
ResponseError – if the response did not have a valid status code.
- Return type
Any
-