Documentation ¶
Overview ¶
oms is openM++ JSON web-service which is also used as simple web-server for openM++ UI html pages.
Web-service allow to view and update model database(s) and run openM++ models from models/bin subdirectory. Web-server allow to serve static html (css, images, javascipt) content from html subdirectory.
Arguments for oms can be specified on command line or through .ini file:
oms -ini my.ini oms -OpenM.IniFile my-oms.ini
Command line arguments take precedence over ini-file options.
Following arguments supporetd by oms:
-oms.ApiOnly false
if true then API only web-service, it is false by default and oms also act as http server for openM++ UI.
-oms.RootDir some/path
oms root directory, default: current directory. Expected to have /html subdirectory unless -oms.ApiOnly true specified. Expected to have /models/bin subdirectory unless other location specified: -oms.ModelDir /some/models/bin. Recommended to have /models/log subdirectory unless other location specified: -oms.ModelLogDir /some/models/log. Expected to have /etc subdirectory with templates to run models on MPI cluster. Recommended to have /log subdirectory to store oms we-service log files.
-oms.ModelDir models/bin
models directory, default: models/bin, if relative then must be relative to oms root directory. It must contain model.sqlite database files and model executables.
-oms.ModelLogDir models/log
models log directory, default: models/log, if relative then must be relative to oms root directory.
-l localhost:4040 -oms.Listen localhost:4040
address to listen, default: localhost:4040. Use -l :4040 if you need to access oms web-service from other computer (make sure firewall configured properly).
-oms.LogRequest false
if true then log HTTP requests on console and/or log file.
-oms.MaxRowCount 100
default number of rows to return from read parameters or output tables, default: 100. This value is used if web-service method call does not provide explicit number of rows to read.
-oms.Languages en
comma-separated list of supported languages, default: en. That list is matched with request language list and model language list in order to return proper text results.
-oms.DoubleFormat %.15g
format to convert float or double value to string, default: %.15g. OpenM++ is using hash digest to compare models, input parameters and output values. By default float and double values converted into text with "%.15g" format.
-oms.CodePage
"code page" to convert source file into utf-8, for example: windows-1252. It is used only for compatibility with old Windows files.
-oms.MaxRunHistory 100
max number of model runs to keep in run list history, default: 100.
Also oms support OpenM++ standard log settings (described in wiki at http://www.openmpp.org/wiki/):
-OpenM.LogToConsole: if true then log to standard output, default: true -v: short form of: -OpenM.LogToConsole -OpenM.LogToFile: if true then log to file -OpenM.LogFilePath: path to log file, default = current/dir/exeName.log -OpenM.LogUseDailyStamp: if true then use dayily stamp in log file name (rotate log files dayily) -OpenM.LogUseTs: if true then use time-stamp in log file name -OpenM.LogUsePid: if true then use pid-stamp in log file name -OpenM.LogSql: if true then log sql statements into log file
Source Files ¶
- common.go
- getModel.go
- getModelExtra.go
- getModelText.go
- getRun.go
- getTask.go
- getWorkset.go
- handlerAdmin.go
- handlerGet.go
- handlerRead.go
- handlerReadCsv.go
- handlerRunModel.go
- handlerUpdate.go
- modelCatalog.go
- oms.go
- readValue.go
- runCatalog.go
- runLog.go
- runModel.go
- updateExtra.go
- updateRun.go
- updateTask.go
- updateWorkset.go
- useCatalog.go
- valueConverter.go