API

Endpoints

/results

class slaveapi.web.results.Results

Provides results from previously requested actions.

get()

Returns all results from all previously requested actions in JSON format.

Returns:
See slaveapi.actions.results.dictify_results() for details on the format of the returned data.

/slaves/:slave/actions/aws_create_instance

class slaveapi.web.slave.AWSCreateInstance(*args, **kwargs)

Request an AWS slave to be instantiated. See slaveapi.web.action_base.ActionView for details on GET and POST methods. See :py:func:`slaveapi.actions.aws_create_instance.aws_create_instance for details on what options are supported

/slaves/:slave/actions/buildslave_last_activity

class slaveapi.web.slave.GetLastActivity(*args, **kwargs)

Request the last activity age (in seconds). See slaveapi.web.action_base.ActionView for details on GET and POST methods. See slaveapi.actions.buildslave_last_activity.buildslave_last_activity() for details on how LastActivity is retrieved.

/slaves/:slave/actions/buildslave_uptime

class slaveapi.web.slave.GetUptime(*args, **kwargs)

Request the build slave uptime (in seconds). See slaveapi.web.action_base.ActionView for details on GET and POST methods. See slaveapi.actions.buildslave_uptime.buildslave_uptime() for details on how Uptime is retrieved.

/slaves/:slave/actions/disable

class slaveapi.web.slave.Disable(*args, **kwargs)

Request a slave to be disabled. See slaveapi.web.action_base.ActionView for details on GET and POST methods. See slaveapi.actions.disable.disable() for details on what options are supported

/slaves/:slave/actions/reboot

class slaveapi.web.slave.Reboot(*args, **kwargs)

Request a reboot of a slave or get status on a previously requested reboot. See slaveapi.web.action_base.ActionView for details on GET and POST methods. See slaveapi.actions.reboot.reboot() for details on how reboots are performed.

/slaves/:slave/actions/shutdown_buildslave

class slaveapi.web.slave.ShutdownBuildslave(*args, **kwargs)

Request a shutdown of a buildslave or get status on a previously requested shutdown. See slaveapi.web.action_base.ActionView for details on GET and POST methods. See slaveapi.actions.shutdown_buildslave.shutdown_buildslave() for details on how buildslave shutdowns are performed.

/slaves/:slave/actions/start

class slaveapi.web.slave.AWSStartInstance(*args, **kwargs)

Start aws instance if it exists. slaveapi.web.action_base.ActionView for details on GET and POST methods. See slaveapi.actions.aws_start_instance.aws_start_instance() for details on how LastActivity is retrieved.

/slaves/:slave/actions/stop

class slaveapi.web.slave.AWSStopInstance(*args, **kwargs)

Stop aws instance if it exists. slaveapi.web.action_base.ActionView for details on GET and POST methods. See slaveapi.actions.aws_stop_instance.aws_stop_instance() for details on how LastActivity is retrieved.

/slaves/:slave/actions/terminate

class slaveapi.web.slave.AWSTerminateInstance(*args, **kwargs)

Terminate aws instance if it exists. slaveapi.web.action_base.ActionView for details on GET and POST methods. See slaveapi.actions.aws_terminate_instance.aws_terminate_instance() for details on how LastActivity is retrieved.

Helpers

ActionView

class slaveapi.web.action_base.ActionView

Abstract base class for views that expose actions. Subclasses must set “action”, which should be a callable that accepts a slave name as its first argument. Subclasses should set this in their __init__ rather than as a class attribute, otherwise Python will turn it into a class method and pass along “self” to the action – which actions don’t generally expect. If the action requires extra arguments (eg, arguments sent through POST data), the subclass should override the “post” method and pass them to it.

get(slave)

Retrieve results from an action.

URL Args:
slave (str): The slave to retrieve results for.
Query Args:
requestid (int): If specified, returns only the results for this specific previous action.. If not passed, results from all previous actions of this type are returned.
Returns:
The status of the request specified or the status of all previous actions of this type. See slaveapi.actions.results.ActionResult.to_dict() for details on what status looks like.
post(slave, *action_args, **action_kwargs)

Request an action of a slave.

URL Args:
slave: The slave to perform the action against.
Query Args:
waittime: How long to wait (in seconds) for the action to complete before returning a requestid to the user and continuing the work in the background.
Returns:
The status of the action, after waiting waittime for it to complete. See slaveapi.actions.results.ActionResult.to_dict() for details on what status looks like.