tac.gui.launcher.api.resources package

Submodules

tac.gui.launcher.api.resources.agents module

Implement the agent resource and other utility classes.

class tac.gui.launcher.api.resources.agents.Agent

Bases: flask_restful.Resource

The agent REST resource.

delete()

Delete the current agent instance.

get()

Get the current instance of the agent.

methods = {'DELETE', 'GET', 'POST'}
post()

Create an agent instance.

class tac.gui.launcher.api.resources.agents.AgentRunner(id: int, params: Dict[str, Any])

Bases: object

Wrapper class to track the execution of an agent script.

property status

Return the state of the execution.

stop()

Stop the execution of the sandbox.

to_dict()

Serialize the object into a dictionary.

class tac.gui.launcher.api.resources.agents.AgentState

Bases: enum.Enum

The state of execution of an agent.

FAILED = 'failed'
FINISHED = 'finished'
NOT_STARTED = 'not_started'
RUNNING = 'running'

tac.gui.launcher.api.resources.sandboxes module

Implement the sandbox resource and other utility classes.

class tac.gui.launcher.api.resources.sandboxes.Sandbox

Bases: flask_restful.Resource

The sandbox REST resource.

delete(sandbox_id)

Delete the current sandbox instance.

get(sandbox_id)

Get the current instance of the sandbox.

methods = {'DELETE', 'GET'}
class tac.gui.launcher.api.resources.sandboxes.SandboxList

Bases: flask_restful.Resource

Resource to handle sandboxes.

get()

Get all the sandboxes.

methods = {'GET', 'POST'}
post()

Create a sandbox instance.

class tac.gui.launcher.api.resources.sandboxes.SandboxProcessState

Bases: enum.Enum

The state of execution of a sandbox.

FAILED = 'Failed'
FINISHED = 'Finished'
NOT_STARTED = 'Not started yet'
RUNNING = 'Running'
STOPPING = 'Stopping'
class tac.gui.launcher.api.resources.sandboxes.SandboxRunner(id: int, params: Dict[str, Any], game_id: str)

Bases: object

Wrapper class to track the execution of a sandbox.

property status

Return the state of the execution.

stop() → None

Stop the sandbox.

to_dict() → Dict[str, Any]

Convert class data into dictionary so we can jasonise it and send it to web frontend.

wait()

Wait for the completion of the sandbox.

Module contents

Define all the REST resources for the launcher APIs.