AFL.automation.APIServer.APIServer#

Functions

create_access_token(identity[, fresh, ...])

Create a new access token.

create_refresh_token(identity[, ...])

Create a new refresh token.

get_jwt_identity()

In a protected endpoint, this will return the identity of the JWT that is accessing the endpoint.

jsonify(*args, **kwargs)

Serialize the given arguments as JSON, and return a Response object with the application/json mimetype.

jwt_required([optional, fresh, refresh, ...])

A decorator to protect a Flask endpoint with JSON Web Tokens.

listify(obj)

render_template(template_name_or_list, **context)

Render a template by name with the given context.

send_file(path_or_file[, mimetype, ...])

Send the contents of a file to the client.

set_access_cookies(response, ...[, max_age, ...])

Modifiy a Flask Response to set a cookie containing the access JWT.

set_refresh_cookies(response, ...[, ...])

Modifiy a Flask Response to set a cookie containing the refresh JWT.

strtobool(val)

Convert a string representation of truth to true (1) or false (0).

unset_jwt_cookies(response[, domain])

Modifiy a Flask Response to delete the cookies containing access or refresh JWTs.

Classes

APIServer(name[, data, experiment, contact, ...])

CORS([app])

Initializes Cross Origin Resource sharing for the application.

FileHandler(filename[, mode, encoding, ...])

A handler class which writes formatted logging records to disk files.

Flask(import_name[, static_url_path, ...])

The flask object implements a WSGI application and acts as the central object.

IPVersion(value[, names, module, qualname, ...])

JWTManager([app, add_context_processor])

An object used to hold JWT settings and callback functions for the Flask-JWT-Extended extension.

LoggerFilter(*filters)

MutableQueue()

Thread-safe, mutable queue

QueueDaemon(app, driver, task_queue, history)

SMTPHandler(mailhost, fromaddr, toaddrs, subject)

A handler class which sends an SMTP email for each logging event.

ServiceInfo

Service information.

Zeroconf([interfaces, unicast, ip_version, ...])

Implementation of Zeroconf Multicast DNS Service Discovery

class AFL.automation.APIServer.APIServer.APIServer(name, data=None, experiment='Development', contact='tbm@nist.gov', index_template='index.html', new_index_template='index-new.html', plot_template='simple-bokeh.html')[source]#
__init__(name, data=None, experiment='Development', contact='tbm@nist.gov', index_template='index.html', new_index_template='index-new.html', plot_template='simple-bokeh.html')[source]#
create_queue(driver, add_unqueued=True)[source]#
reset_queue_daemon(driver=None)[source]#
advertise_zeroconf(**kwargs)[source]#
run(**kwargs)[source]#
run_threaded(start_thread=True, **kwargs)[source]#
add_standard_routes()[source]#
get_info()[source]#

Live, status page of the robot

get_quickbar()[source]#

Return the functions, params, and defaults to be shown in this server’s quickbar

is_server_live()[source]#
get_unqueued_commands()[source]#
get_queued_commands()[source]#
add_unqueued_routes()[source]#
query_driver()[source]#
init_logging(toaddrs=None)[source]#
index()[source]#

Render the legacy status board

index_new()[source]#

Render the new driver UI

webapp()[source]#

Render the jquery webapp

render_unqueued(func, kwargs_add, **kwargs)[source]#

Convert an unqueued return item into web-suitable output

send_1d_plot(result, multi=False, **kwargs)[source]#
send_array_as_jpg(array, log_image=False, max_val=None, fillna=0.0, **kwargs)[source]#
queue_state()[source]#
driver_status()[source]#
get_queue()[source]#
get_queue_iteration()[source]#
deposit_obj()[source]#

Store an object named obj in the driver’s dropbox If a uuid is provided, the object will be stored with that uuid Otherwise, a new uuid will be generated. In either case, the uuid will be returned to the client.

retrieve_obj()[source]#

Retrieve an object from the driver’s dropbox uuid specifies the object to retrieve delete specifies whether to delete the object after retrieval

set_driver_object()[source]#
get_driver_object()[source]#
enqueue()[source]#
reorder_queue()[source]#
remove_items()[source]#
remove_item()[source]#
move_item()[source]#
clear_queue()[source]#
clear_history()[source]#
debug()[source]#
pause()[source]#
halt()[source]#
init()[source]#
login()[source]#
get_server_time()[source]#
login_test()[source]#