stochss_compute.client package

Submodules

stochss_compute.client.compute_server module

ComputeServer(Server)

class stochss_compute.client.compute_server.ComputeServer(host: str, port: int = 29681)[source]

Bases: Server

Simple object representing a remote instance of StochSS-Compute.

Parameters:
  • host (str) – Address of the remote server.

  • port (int) – Port on which to connect. Defaults to 29681.

property address: str

The server’s IP address and port.

Returns:

http://{host}:{port}”

stochss_compute.client.endpoint module

Endpoint(Enum)

class stochss_compute.client.endpoint.Endpoint(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

API Endpoints.

CLOUD = 2
SIMULATION_GILLESPY2 = 1

stochss_compute.client.server module

Server(ABC)

class stochss_compute.client.server.Server[source]

Bases: ABC

Abstract Server class with hard coded endpoints.

Raises:

TypeError – Server cannot be instantiated directly. Must be ComputeServer or Cluster.

abstract property address

NotImplemented

get(endpoint: Endpoint, sub: str)[source]

Send a GET request to endpoint.

Parameters:
  • endpoint (Endpoint) – The API endpoint.

  • sub (str) – Final part of url string.

Returns:

The HTTP response.

Return type:

requests.Response

post(endpoint: Endpoint, sub: str, request: Request = None)[source]

Send a POST request to endpoint.

Parameters:
  • endpoint (Endpoint) – The API endpoint.

  • sub (str) – Final part of url string.

  • request (Request) – An object that inherits from Request.

Returns:

The HTTP response.

Return type:

requests.Response

Module contents

stochss_compute.client