Next: , Previous: , Up: Software Evolution Library Index   [Contents][Index]


A.2 SOFTWARE-EVOLUTION-LIBRARY/COMMAND-LINE-REST

Variable: *address* [sel/command-line-rest]

Address on which to bind the clack server.

Variable: *port* [sel/command-line-rest]

Port on which to run the clack server.

Macro: define-command-async-rest [sel/command-line-rest] (name &key environment status) args pre-help post-help &body body

Define a function, executable, and a REST server function and executable.

Invokes ‘define-command’ on name args pre-help post-help and body to define the name function and the run-name command-line executable entry point. See the definition of ‘define-command’ for more information on these arguments.

Use the above arguments and the additional environment and status keywords to define an asynchronous REST entry point which runs the function name asynchronously returning a job id and another entry point which may be used to retrieve the status of the async job. A new run-serve-name command-line executable entry point is defined.

environment : List of variables which should be let-bound around the execution of the REST end-point.

status : A function which will be invoked in the dynamic environment of the running job to return the status of the job or, when finished, to return the result.

Macro: defroute [sel/command-line-rest] name &body args

Define name as a specific route on a generic REST resource. args are just as in cl:defmethod with the exception that its specialized-lambda-list portion accepts some simplifications.

Function: decode-json-from-string [sel/command-line-rest] json-string

Read a JSON Value from json-string and return the corresponding Lisp value.

Function: encode-json-to-string [sel/command-line-rest] object

Return the JSON representation of object as a string.

Function: http-condition [sel/command-line-rest] status-code &optional format-control &rest format-args

Signal an HTTP condition with status-code with with cl:error.

Function: make-clack-app [sel/command-line-rest] &optional bindings

Make a basic Clack app that calls handle-request.

Pass this to clack:clackup.

Dynamically binds *clack-request-env* around every call to handle-request so you can access the backend-specific from routes and/or explain-condition. Also binds *backend* to :clack.

bindings is an alist of (symbol . value) which is are also dynamically-bound around handle-request. You can use it to pass values of special variables that affect Snooze, like *home-resource*, *resources-function*, *resource-name-function*, or *uri-content-types-function*.

Function: payload-as-string [sel/command-line-rest] &optional backend

Return the current HTTP request’s payload as a string.

backend defaults to *backend*


Next: , Previous: , Up: Software Evolution Library Index   [Contents][Index]