Web Service and Demonstration Applications¶
Included in SMQTK are a few web-based service and demonstration applications, providing a view into the functionality provided by SMQTK algorithms and utilities.
runApplication¶
This script can be used to run any conforming (derived from SmqtkWebApp) SMQTK web based application.
Web services should be runnable via the bin/runApplication.py
script.
Runs conforming SMQTK Web Applications.
usage: runApplication [-h] [-v] [-c PATH] [-g PATH] [-l] [-a APPLICATION] [-r]
[-t] [--host HOST] [--port PORT] [--use-basic-auth]
[--debug-server] [--debug-smqtk]
Named Arguments¶
-v, --verbose | Output additional debug logging. Default: False |
Configuration¶
-c, --config | Path to the JSON configuration file. |
-g, --generate-config | |
Optionally generate a default configuration file at the specified path. If a configuration file was provided, we update the default configuration with the contents of the given configuration. |
Application Selection¶
-l, --list | List currently available applications for running. More description is included if SMQTK verbosity is increased (-v | –debug-smqtk) Default: False |
-a, --application | |
Label of the web application to run. |
Server options¶
-r, --reload | Turn on server reloading. Default: False |
-t, --threaded | Turn on server multi-threading. Default: False |
--host | Run host address specification override. This will override all other configuration method specifications. |
--port | Run port specification override. This will override all other configuration method specifications. |
--use-basic-auth | |
Use global basic authentication as configured. Default: False |
Other options¶
--debug-server | Turn on server debugging messages ONLY Default: False |
--debug-smqtk | Turn on SMQTK debugging messages ONLY Default: False |
SmqtkWebApp¶
This is the base class for all web applications and services in SMQTK.
-
class
smqtk.web.
SmqtkWebApp
(json_config)[source]¶ Base class for SMQTK web applications
-
classmethod
from_config
(config_dict, merge_default=True)[source]¶ Override to just pass the configuration dictionary to constructor
-
get_config
()[source]¶ Return a JSON-compliant dictionary that could be passed to this class’s
from_config
method to produce an instance with identical configuration.In the common case, this involves naming the keys of the dictionary based on the initialization argument names as if it were to be passed to the constructor via dictionary expansion.
Returns: JSON type compliant configuration dictionary. Return type: dict
-
classmethod
get_default_config
()[source]¶ Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
This should be overridden in each implemented application class to add appropriate configuration.
Returns: Default configuration dictionary for the class. Return type: dict
-
classmethod