aihwkit.cloud.client.v1.stubs module

API stubs for the AIHW Composer API.

class aihwkit.cloud.client.v1.stubs.ApiStub(session)[source]

Bases: object

Base API stub for the AIHW Composer.

API stub for use in the client for the AIHW Composer in order to interact with REST endpoints.

Subclasses should inherit from this class, customizing base_url and applying any extra changes. By default, the stub assumes three operations for the entities:

  • get (via self.get()): a GET operation returning a single object from an id.

  • post (via self.post()): a POST operation.

  • list (via self.list()): a GET operation returning multiple objects.

Parameters:

session (ApiSession) –

base_url = ''

Base url to be used in the endpoints.

get(object_id)[source]

Return a single entity by id.

Parameters:

object_id (str) – the id of the entity.

Returns:

A dictionary with the entity.

Return type:

Dict

list()[source]

Return a list of entities.

Returns:

A list of entities.

Return type:

Dict

post(content)[source]

Create a single entity.

Parameters:

content (Dict) – the content of the entity.

Returns:

A dictionary with the API response.

Return type:

Dict

class aihwkit.cloud.client.v1.stubs.Endpoint(url, method)

Bases: tuple

method

Alias for field number 1

url

Alias for field number 0

class aihwkit.cloud.client.v1.stubs.ExperimentStub(session)[source]

Bases: ApiStub

Stub for experiment.

Parameters:

session (ApiSession) –

base_url = 'experiments'

Base url to be used in the endpoints.

class aihwkit.cloud.client.v1.stubs.InputStub(session)[source]

Bases: ApiStub

Stub for input.

Parameters:

session (ApiSession) –

base_url = 'inputs'

Base url to be used in the endpoints.

class aihwkit.cloud.client.v1.stubs.JobStub(session)[source]

Bases: ApiStub

Stub for job.

Parameters:

session (ApiSession) –

base_url = 'jobs'

Base url to be used in the endpoints.

class aihwkit.cloud.client.v1.stubs.LoginStub(session)[source]

Bases: ApiStub

Stub for login.

Parameters:

session (ApiSession) –

base_url = 'token/login'

Base url to be used in the endpoints.

class aihwkit.cloud.client.v1.stubs.OutputStub(session)[source]

Bases: ApiStub

Stub for output.

Parameters:

session (ApiSession) –

base_url = 'outputs'

Base url to be used in the endpoints.