csdms

wmtexe.slave module

Tools to initiate and monitor tasks in a wmt-exe environment.

class wmtexe.slave.Slave(url, env=None, dir='.')[source]

Bases: object

Task slave for a wmt-exe environment.

Parameters:

url : str

URL of API server.

env : WmtEnvironment, optional

WMT environment variables (default is None).

dir : str, optional

The working directory for the job (default is current directory).

Attributes

url Get the API server URL.

Methods

report(id, status, message) Report task status using requests.
report_error(id, message) Report errors from a job.
report_success(id, message) Report job success.
start_task(id[, env, dir]) Start tasks for the given job id.
report(id, status, message)[source]

Report task status using requests.

Parameters:

id : str

The unique UUID for the job.

status : str

Type of report.

message : str

Message for report.

Returns:

Reponse

Response from server.

report_error(id, message)[source]

Report errors from a job.

Parameters:

id : str

The unique UUID for the job.

message : str

The error message.

Returns:

Reponse

Response from server.

report_success(id, message)[source]

Report job success.

Parameters:

id : str

The unique UUID for the job.

message : str

The success message.

Returns:

Reponse

Response from server.

start_task(id, env=None, dir='.')[source]

Start tasks for the given job id.

Parameters:

id : str

The unique UUID for the job.

env : WmtEnvironment, optional

WMT environment variables (default is None).

dir : str, optional

The working directory for the job (default is current directory).

Returns:

Reponse

Response from server.

url

Get the API server URL.

Returns:

str

The API server URL.