| Title: | Programmatic Interface to 'OpenM++' |
|---|---|
| Description: | A programmatic interface to the 'OpenM++' microsimulation platform (<https://openmpp.org>). The primary goal of this package is to wrap the 'OpenM++' Web Service (OMS) to provide 'OpenM++' users a programmatic interface for the R language. |
| Authors: | Matthew T. Warkentin [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-8730-3511>), John M. Hutchinson [ctb] |
| Maintainer: | Matthew T. Warkentin <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.2.9000 |
| Built: | 2026-06-07 07:00:58 UTC |
| Source: | https://github.com/mattwarkentin/openmpp |
Functions for performing administrative tasks. More information about the administrative API endpoints can be found at here.
admin_models_refresh() admin_models_close() admin_database_close(model) admin_model_delete(model) admin_database_open(path) admin_database_cleanup(path, name = NULL, digest = NULL) admin_cleanup_logs() admin_cleanup_log(name) admin_jobs_pause(pause) admin_jobs_pause_all(pause) admin_service_shutdown()admin_models_refresh() admin_models_close() admin_database_close(model) admin_model_delete(model) admin_database_open(path) admin_database_cleanup(path, name = NULL, digest = NULL) admin_cleanup_logs() admin_cleanup_log(name) admin_jobs_pause(pause) admin_jobs_pause_all(pause) admin_service_shutdown()
model |
Model digest or model name. |
path |
Path to model database file relative to the |
name |
Model name. Optional for |
digest |
Model digest. Optional for |
pause |
Logical. Whether to pause or resume model runs queue processing. |
To find the relative path to a database file for cleanup with
admin_database_cleanup(path) or opening a database file with
admin_database_open(path), users can run the get_models_list()
function to retrieve the list of model information and find the DbPath
list item. DbPath is the relative path to the database file. You
must replace the forward-slashes in the relative path with asterisks.
A list or nothing, invisibly.
## Not run: use_OpenMpp_local() admin_models_refresh() ## End(Not run)## Not run: use_OpenMpp_local() admin_models_refresh() ## End(Not run)
Manage Model Scenarios
create_scenario(model, name, base = NULL) create_workset(model, name, base = NULL)create_scenario(model, name, base = NULL) create_workset(model, name, base = NULL)
model |
Model name or digest. |
name |
New scenario name. |
base |
Base run digest (optional). |
Nothing, invisibly.
## Not run: use_OpenMpp_local() create_scenario("RiskPaths", "NewScenario") ## End(Not run)## Not run: use_OpenMpp_local() create_scenario("RiskPaths", "NewScenario") ## End(Not run)
Functions for updating modeling tasks. More information about these API endpoints can be found at here.
create_task(data) update_task(data) delete_task(model, task)create_task(data) update_task(data) delete_task(model, task)
data |
Data used for the body of the request. |
model |
Model digest or model name. |
task |
Modeling task. |
A list, tibble, or nothing (invisibly).
## Not run: use_OpenMpp_local() create_task(list( ModelName = "RiskPaths", ModelDigest = "d976aa2fb999f097468bb2ea098c4daf", Name = "NewTask", Set = list("Default") )) delete_task("RiskPaths", "NewTask") ## End(Not run)## Not run: use_OpenMpp_local() create_task(list( ModelName = "RiskPaths", ModelDigest = "d976aa2fb999f097468bb2ea098c4daf", Name = "NewTask", Set = list("Default") )) delete_task("RiskPaths", "NewTask") ## End(Not run)
Functions to update model runs. More information about these API endpoints can be found at here.
delete_model_run(model, run) delete_run(model, run) delete_model_runs(model) delete_runs(model)delete_model_run(model, run) delete_run(model, run) delete_model_runs(model) delete_runs(model)
model |
Model digest or model name. |
run |
Model run digest, run stamp or run name, modeling task run stamp or task run name. |
A list, tibble, or nothing (invisibly).
## Not run: use_OpenMpp_local() delete_model_run("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137") ## End(Not run)## Not run: use_OpenMpp_local() delete_model_run("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137") ## End(Not run)
Functions to get the list of models and load a specific model definition. More information about these API endpoints can be found at here.
get_model(model) get_models() get_models_list()get_model(model) get_models() get_models_list()
model |
Model digest or model name. |
A list or tibble.
## Not run: use_OpenMpp_local() get_models() get_models_list() get_model("RiskPaths") ## End(Not run)## Not run: use_OpenMpp_local() get_models() get_models_list() get_model("RiskPaths") ## End(Not run)
Functions for retrieving extra model information, including language lists, word lists, profiles, and profile lists. More information about these API endpoints can be found at here.
get_model_lang_list(model) get_model_word_list(model) get_model_profile(model, profile) get_model_profile_list(model)get_model_lang_list(model) get_model_word_list(model) get_model_profile(model, profile) get_model_profile_list(model)
model |
Model digest or model name. |
profile |
Profile name. |
A list from a JSON response object.
## Not run: use_OpenMpp_local() get_model_lang_list('RiskPaths') ## End(Not run)## Not run: use_OpenMpp_local() get_model_lang_list('RiskPaths') ## End(Not run)
Functions to retrieve model run metadata and delete model runs. More information about these API endpoints can be found at here.
get_model_run(model, run) get_run(model, run) get_model_runs_list(model) get_model_runs(model) get_runs(model) get_model_run_status(model, run) get_run_status(model, run) get_model_run_list_status(model, run) get_model_run_status_first(model) get_model_run_status_last(model) get_model_run_status_compl(model)get_model_run(model, run) get_run(model, run) get_model_runs_list(model) get_model_runs(model) get_runs(model) get_model_run_status(model, run) get_run_status(model, run) get_model_run_list_status(model, run) get_model_run_status_first(model) get_model_run_status_last(model) get_model_run_status_compl(model)
model |
Model digest or model name. |
run |
Model run digest, run stamp or run name, modeling task run stamp or task run name. |
A list, tibble, or nothing (invisibly).
## Not run: use_OpenMpp_local() get_model_run("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137") get_run("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137") get_model_runs_list("RiskPaths") get_model_runs("RiskPaths") ## End(Not run)## Not run: use_OpenMpp_local() get_model_run("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137") get_run("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137") get_model_runs_list("RiskPaths") get_model_runs("RiskPaths") ## End(Not run)
Functions for getting creating, updating, retrieving, and deleting model tasks. More information about these API endpoints can be found at here.
get_model_task(model, task) get_model_tasks_list(model) get_model_tasks(model) get_model_task_worksets(model, task) get_model_task_hist(model, task) get_model_task_status(model, task, run) get_model_task_run_list_status(model, task, run) get_model_task_run_first(model, task) get_model_task_run_last(model, task) get_model_task_run_compl(model, task)get_model_task(model, task) get_model_tasks_list(model) get_model_tasks(model) get_model_task_worksets(model, task) get_model_task_hist(model, task) get_model_task_status(model, task, run) get_model_task_run_list_status(model, task, run) get_model_task_run_first(model, task) get_model_task_run_last(model, task) get_model_task_run_compl(model, task)
model |
Model digest or model name. |
task |
Modeling task. |
run |
Model run digest, run stamp or run name, modeling task run stamp or task run name. |
A list, tibble, or nothing (invisibly).
## Not run: use_OpenMpp_local() get_model_tasks_list("RiskPaths") get_model_tasks("RiskPaths") ## End(Not run)## Not run: use_OpenMpp_local() get_model_tasks_list("RiskPaths") get_model_tasks("RiskPaths") ## End(Not run)
Functions for retrieving microdata from model runs. More information about these API endpoints can be found at here.
get_run_microdata(model, run, name) get_run_microdata_csv(model, run, name)get_run_microdata(model, run, name) get_run_microdata_csv(model, run, name)
model |
Model digest or model name. |
run |
Model run digest, run stamp or run name, modeling task run stamp, or task run name. |
name |
Microdata entity name. |
A list or tibble.
## Not run: use_OpenMpp_local() get_run_microdata_csv("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137", "Person") ## End(Not run)## Not run: use_OpenMpp_local() get_run_microdata_csv("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137", "Person") ## End(Not run)
Functions for retrieving output tables from model runs. More information about these API endpoints can be found at here.
get_run_table(model, run, name) get_run_table_csv(model, run, name) get_run_table_acc_csv(model, run, name) get_run_table_calc_csv(model, run, name, calc) get_run_table_comparison_csv(model, run, name, compare, variant)get_run_table(model, run, name) get_run_table_csv(model, run, name) get_run_table_acc_csv(model, run, name) get_run_table_calc_csv(model, run, name, calc) get_run_table_comparison_csv(model, run, name, compare, variant)
model |
Model digest or model name. |
run |
Model run digest, run stamp or run name, modeling task run stamp or task run name. |
name |
Output table name. |
calc |
Name of calculation. One of |
compare |
Comparison to calculate. One of |
variant |
Run digest, name, or stamp for the variant model run. |
A list or tibble.
## Not run: use_OpenMpp_local() get_run_table_csv("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137", "T01_LifeExpectancy") ## End(Not run)## Not run: use_OpenMpp_local() get_run_table_csv("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137", "T01_LifeExpectancy") ## End(Not run)
Functions for retrieving or deleting service information. More information about these API endpoints can be found at here.
get_service_config() get_service_state() get_disk_use() refresh_disk_use() get_active_job_state(job) get_queue_job_state(job) get_hist_job_state(job) set_queue_job_pos(pos, job) delete_job_hist(job)get_service_config() get_service_state() get_disk_use() refresh_disk_use() get_active_job_state(job) get_queue_job_state(job) get_hist_job_state(job) set_queue_job_pos(pos, job) delete_job_hist(job)
job |
Model run submission time stamp. |
pos |
Position. |
A list from a JSON response object, or nothing (invisibly).
## Not run: use_OpenMpp_local() get_service_config() get_service_state() get_disk_use() ## End(Not run)## Not run: use_OpenMpp_local() get_service_config() get_service_state() get_disk_use() ## End(Not run)
Functions for getting, setting, and deleting user file. More information about these API endpoints can be found at here.
get_user_files(ext = "*", path = "") upload_user_files(path) create_user_files_folder(path) delete_user_files(path) delete_user_files_all()get_user_files(ext = "*", path = "") upload_user_files(path) create_user_files_folder(path) delete_user_files(path) delete_user_files_all()
ext |
Comma-separated string of file extensions. Default is |
path |
Optional file path. Default is |
A list from JSON response object or nothing (invisibly).
## Not run: use_OpenMpp_local() get_user_files() ## End(Not run)## Not run: use_OpenMpp_local() get_user_files() ## End(Not run)
Functions for getting, setting, and deleting user settings. More information about these API endpoints can be found at here.
get_user_views(model) set_user_views(model, data) delete_user_views(model)get_user_views(model) set_user_views(model, data) delete_user_views(model)
model |
Model digest or model name. |
data |
Data used for the body of the request. |
A list from JSON response object or nothing (invisibly).
## Not run: use_OpenMpp_local() get_user_views("RiskPaths") ## End(Not run)## Not run: use_OpenMpp_local() get_user_views("RiskPaths") ## End(Not run)
Functions for creating, copying, merging, retrieving, and deleting worksets. More information about these API endpoints can be found at here.
get_workset(model, set) get_worksets_list(model) get_worksets(model) get_scenarios(model) get_workset_status(model, set) get_workset_status_default(model)get_workset(model, set) get_worksets_list(model) get_worksets(model) get_scenarios(model) get_workset_status(model, set) get_workset_status_default(model)
model |
Model digest or model name. |
set |
Name of workset (input set of model parameters). |
A list, tibble, or nothing (invisibly).
## Not run: use_OpenMpp_local() get_worksets("RiskPaths") get_scenarios("RiskPaths") get_workset("RiskPaths", "Default") ## End(Not run)## Not run: use_OpenMpp_local() get_worksets("RiskPaths") get_scenarios("RiskPaths") get_workset("RiskPaths", "Default") ## End(Not run)
Functions for retrieving parameters from worksets or model runs. More information about these API endpoints can be found at here.
get_workset_param(model, set, name) get_workset_param_csv(model, set, name) get_run_param(model, run, name) get_run_param_csv(model, run, name)get_workset_param(model, set, name) get_workset_param_csv(model, set, name) get_run_param(model, run, name) get_run_param_csv(model, run, name)
model |
Model digest or model name. |
set |
Name of workset (input set of model parameters). |
name |
Output table name. |
run |
Model run digest, run stamp or run name, modeling task run stamp or task run name. |
A list or tibble.
## Not run: use_OpenMpp_local() get_workset_param("RiskPaths", "Default", "AgeBaselinePreg1") ## End(Not run)## Not run: use_OpenMpp_local() get_workset_param("RiskPaths", "Default", "AgeBaselinePreg1") ## End(Not run)
Functions to download model, model run results, or input parameters. More information about these API endpoints can be found at here.
initiate_model_download(model) initiate_run_download(model, run) initiate_workset_download(model, set) delete_download_files(folder) delete_download_files_async(folder) get_download_log(name) get_download_logs_model(model) get_download_logs_all() get_download_filetree(folder)initiate_model_download(model) initiate_run_download(model, run) initiate_workset_download(model, set) delete_download_files(folder) delete_download_files_async(folder) get_download_log(name) get_download_logs_model(model) get_download_logs_all() get_download_filetree(folder)
model |
Model digest or model name. |
run |
Model run digest, run stamp or run name, modeling task run stamp or task run name. |
set |
Name of workset (input set of model parameters). |
folder |
Download folder file name. |
name |
Output table name. |
Nothing, invisibly.
## Not run: use_OpenMpp_local() get_download_logs_model('RiskPaths') ## End(Not run)## Not run: use_OpenMpp_local() get_download_logs_model('RiskPaths') ## End(Not run)
Functions to upload model run results or input parameters (worksets). More information about these API endpoints can be found at here.
initiate_run_upload(model, run, data) initiate_workset_upload(model, set, data) delete_upload_files(folder) delete_upload_files_async(folder) get_upload_log(name) get_upload_logs_model(model) get_upload_logs_all() get_upload_filetree(folder)initiate_run_upload(model, run, data) initiate_workset_upload(model, set, data) delete_upload_files(folder) delete_upload_files_async(folder) get_upload_log(name) get_upload_logs_model(model) get_upload_logs_all() get_upload_filetree(folder)
model |
Model digest or model name. |
run |
Model run digest, run stamp or run name, modeling task run stamp or task run name. |
data |
Data used for the body of the request. |
set |
Name of workset (input set of model parameters). |
folder |
Upload folder file name. |
name |
Output table name. |
Nothing, invisibly.
## Not run: use_OpenMpp_local() get_upload_logs_all() ## End(Not run)## Not run: use_OpenMpp_local() get_upload_logs_all() ## End(Not run)
Are data frames compatible?
is_compatible(x, y)is_compatible(x, y)
x |
New parameters. |
y |
Old parameters |
OpenM++ Model Class
load_model(model)load_model(model)
model |
Model digest or model name. |
An OpenMppModel instance.
OpenMppTypeOpenM++ object type (used for print() method).
ModelDigestModel digest.
ModelNameModel name.
ModelVersionModel version.
ModelMetadataModel metadata.
ParamsInfoInput parameter information.
TablesInfoOutput table information.
ModelWorksetsData frame of worksets.
ModelScenariosData frame of scenarios.
ModelRunsData frame of model runs.
ModelTasksData frame of model tasks.
new()
Create a new OpenMppModel object.
OpenMppModel$new(model)
modelModel digest or name.
A new OpenMppModel object.
print()
Print a OpenMppModel object.
OpenMppModel$print(...)
...Not currently used.
Self, invisibly.
## Not run: use_OpenMpp_local() load_model("RiskPaths") ## End(Not run)## Not run: use_OpenMpp_local() load_model("RiskPaths") ## End(Not run)
OpenM++ ModelRun Class
load_model_run(model, run) load_run(model, run)load_model_run(model, run) load_run(model, run)
model |
Model digest or model name. |
run |
Model run digest, run stamp or run name, modeling task run stamp or task run name. |
load_run() is an alias for load_model_run().
An OpenMppModelRun instance.
openmpp::OpenMppModel -> OpenMppModelRun
RunNameRun name.
RunDigestRun digest.
RunStampRun stamp.
RunMetadataRun metadata.
ParametersModel run parameters.
TablesModel run output tables
OpenMppTypeOpenM++ object type (used for print()).
RunStatusInfoRun status information.
RunStatusRun status.
new()
Create a new OpenMppModelRun object.
OpenMppModelRun$new(model, run)
modelModel digest or name.
runRun digest, run stamp, or run name.
A new OpenMppModelRun object.
print()
Print a OpenMppModelRun object.
OpenMppModelRun$print(...)
...Not currently used.
Self, invisibly.
get_table()
Retrieve a table.
OpenMppModelRun$get_table(name)
nameTable name.
A tibble.
get_table_acc()
Retrieve a table with all accumulator values.
OpenMppModelRun$get_table_acc(name)
nameTable name.
A tibble.
get_table_calc()
Retrieve a table calculation.
OpenMppModelRun$get_table_calc(name, calc)
nameTable name.
calcName of calculation. One of "avg", "sum", "count",
"max", "min", "var", "sd", "se", or "cv".
A tibble.
get_table_comparison()
Retrieve a table comparison.
OpenMppModelRun$get_table_comparison(name, compare, variant)
nameTable name.
compareComparison to calculate. One of "diff", "ratio", or
"percent".
variantRun digest, name, or stamp for the variant model run.
A tibble.
write_table()
Write an output table to disk (CSV).
OpenMppModelRun$write_table(name, file)
nameTable name.
fileFile path.
Self, invisibly.
write_tables()
Write all output tables to disk (CSV).
OpenMppModelRun$write_tables(dir)
dirDirectory path.
Self, invisibly.
get_log()
Get console log for model run.
OpenMppModelRun$get_log()
Self, invisibly.
write_log()
Write console log for model run to disk.
OpenMppModelRun$write_log(dir)
dirDirectory to save log file.
Self, invisibly.
## Not run: use_OpenMpp_local() load_model_run("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137") load_run("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137") ## End(Not run)## Not run: use_OpenMpp_local() load_model_run("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137") load_run("RiskPaths", "53300e8b56eabdf5e5fb112059e8c137") ## End(Not run)
OpenM++ ModelRunSet Class
load_model_runs(model, runs) load_runs(model, runs)load_model_runs(model, runs) load_runs(model, runs)
model |
Model name or digest. |
runs |
Character vector of model run names, digests, or stamps. |
load_runs() is an alias for load_model_runs().
An OpenMppModelRunSet instance.
ModelDigestModel digest.
ModelNameModel name.
ModelVersionModel version.
OpenMppTypeOpenM++ object type (used for print()).
TablesModel run output tables
RunNamesRun names.
RunDigestsRun digests.
RunStampsRun stamps.
RunStatusesRun statuses.
RunMetadatasRun metadatas.
new()
Create a new OpenMppModelRunSet object.
OpenMppModelRunSet$new(model, runs)
modelModel digest or name.
runsRun digests, run stamps, or run names.
A new OpenMppModelRunSet object.
print()
Print a OpenMppModelRunSet object.
OpenMppModelRunSet$print(...)
...Not currently used.
Self, invisibly.
get_table()
Retrieve a table.
OpenMppModelRunSet$get_table(name)
nameTable name.
A tibble.
get_table_calc()
Retrieve a table calculation.
OpenMppModelRunSet$get_table_calc(name, calc)
nameTable name.
calcName of calculation. One of "avg", "sum", "count",
"max", "min", "var", "sd", "se", or "cv".
A tibble.
write_table()
Write an output table to disk (CSV).
OpenMppModelRunSet$write_table(name, file)
nameTable name.
fileFile path.
Self, invisibly.
write_tables()
Write all output tables to disk (CSV).
OpenMppModelRunSet$write_tables(dir)
dirDirectory path.
Self, invisibly.
## Not run: use_OpenMpp_local() load_model_runs("RiskPaths", rep("53300e8b56eabdf5e5fb112059e8c137", 2)) load_runs("RiskPaths", rep("53300e8b56eabdf5e5fb112059e8c137", 2)) ## End(Not run)## Not run: use_OpenMpp_local() load_model_runs("RiskPaths", rep("53300e8b56eabdf5e5fb112059e8c137", 2)) load_runs("RiskPaths", rep("53300e8b56eabdf5e5fb112059e8c137", 2)) ## End(Not run)
OpenM++ Workset Class
load_workset(model, set) load_scenario(model, set)load_workset(model, set) load_scenario(model, set)
model |
Model digest or model name. |
set |
Name of workset (input set of model parameters). |
load_scenario() is an alias for load_workset().
An OpenMppWorkset instance.
openmpp::OpenMppModel -> OpenMppWorkset
WorksetNameWorkset name.
WorksetMetadataWorkset metadata.
OpenMppTypeOpenM++ object type (used for print()).
ParametersWorkset parameters.
ReadOnlyWorkset read-only status.
BaseRunDigestBase run digest for input parameters.
new()
Create a new OpenMppWorkset object.
OpenMppWorkset$new(model, set)
modelModel digest or name.
setWorkset name.
A new OpenMppWorkset object.
print()
Print a OpenMppWorkset object.
OpenMppWorkset$print(...)
...Not currently used.
Self, invisibly.
set_base_digest()
Set the base run digest.
OpenMppWorkset$set_base_digest(base)
baseBase run digest.
Self, invisibly.
delete_base_digest()
Delete the base run digest.
OpenMppWorkset$delete_base_digest()
Self, invisibly.
copy_params()
Copy parameters from a base scenario.
OpenMppWorkset$copy_params(names)
namesCharacter vector of parameter names.
Self, invisibly.
delete_params()
Delete parameters from scenario.
OpenMppWorkset$delete_params(names)
namesCharacter vector of parameter names.
Self, invisibly.
get_param()
Retrieve a parameter.
OpenMppWorkset$get_param(name)
nameParameter name.
A tibble.
set_param()
Set a parameter.
OpenMppWorkset$set_param(name, data)
nameParameter name.
dataNew parameter data.
Self, invisibly.
run()
Initiate a model run for the model workset/scenario.
OpenMppWorkset$run( name, opts = opts_run(), wait = FALSE, wait_time = 0.2, progress = TRUE )
nameRun name.
optsRun options. See opts_run() for more details.
waitLogical. Should we wait until the model run is done?
wait_timeNumber of seconds to wait between status checks.
progressLogical. Should a progress bar be shown?
Self, invisibly.
## Not run: use_OpenMpp_local() load_workset("RiskPaths", "Default") load_scenario("RiskPaths", "Default") ## End(Not run)## Not run: use_OpenMpp_local() load_workset("RiskPaths", "Default") load_scenario("RiskPaths", "Default") ## End(Not run)
Run Configuration Options
opts_run( SimulationCases = 5000, SubValues = 12, RunStamp = TimeStamp(), Opts = list(), ... ) ## S3 method for class 'OpenMppRunOpts' print(x, ...)opts_run( SimulationCases = 5000, SubValues = 12, RunStamp = TimeStamp(), Opts = list(), ... ) ## S3 method for class 'OpenMppRunOpts' print(x, ...)
SimulationCases |
Number of cases to simulate. Default is 5000. |
SubValues |
Number of sub values. Default is 12. |
RunStamp |
Run stamp. Default is generated based on the current time. |
Opts |
Additional options to pass to the |
... |
Any other run options. |
x |
Object to print. |
The default number of SimulationCases is low to enable rapid
iteration but should be increased when running a model where the results
are expected to be robust.
opts <- opts_run() print(opts)opts <- opts_run() print(opts)
More information about these API endpoints can be found at here.
run_model(data) get_model_run_state(model, stamp) get_run_state(model, stamp) stop_model_run(model, stamp) stop_run(model, stamp)run_model(data) get_model_run_state(model, stamp) get_run_state(model, stamp) stop_model_run(model, stamp) stop_run(model, stamp)
data |
Data used for the body of the POST request. |
model |
Model digest or name. |
stamp |
Model run stamp. |
A list or nothing, invisibly.
## Not run: use_OpenMpp_local() get_model_run_state("RiskPaths", "2025_01_28_21_00_48_385") ## End(Not run)## Not run: use_OpenMpp_local() get_model_run_state("RiskPaths", "2025_01_28_21_00_48_385") ## End(Not run)
Functions for creating, copying, merging, retrieving, and deleting worksets. More information about these API endpoints can be found at here.
set_workset_readonly(model, set, readonly) new_workset(data) merge_workset(workset) update_workset_param_csv(workset, csv) replace_workset(workset) delete_workset(model, set) delete_scenario(model, set) delete_workset_param(model, set, name) update_workset_param(model, set, name, data) copy_param_run_to_workset(model, set, name, run) merge_param_run_to_workset(model, set, name, run) copy_param_workset_to_workset(model, set, name, from) merge_param_workset_to_workset(model, set, name, from) upload_workset_params(model, set, data)set_workset_readonly(model, set, readonly) new_workset(data) merge_workset(workset) update_workset_param_csv(workset, csv) replace_workset(workset) delete_workset(model, set) delete_scenario(model, set) delete_workset_param(model, set, name) update_workset_param(model, set, name, data) copy_param_run_to_workset(model, set, name, run) merge_param_run_to_workset(model, set, name, run) copy_param_workset_to_workset(model, set, name, from) merge_param_workset_to_workset(model, set, name, from) upload_workset_params(model, set, data)
model |
Model digest or model name. |
set |
Name of workset (input set of model parameters). |
readonly |
Boolean. Should workset be read-only? |
data |
Data used for the body of the request. |
workset |
Workset metadata. |
csv |
CSV file path. |
name |
Output table name. |
run |
Model run digest, run stamp or run name, modeling task run stamp or task run name. |
from |
Source workset name. |
A list, tibble, or nothing (invisibly).
## Not run: use_OpenMpp_local() set_workset_readonly("RiskPaths", "Default", TRUE) ## End(Not run)## Not run: use_OpenMpp_local() set_workset_readonly("RiskPaths", "Default", TRUE) ## End(Not run)
Functions for creating, modifying, and deleting profiles and profile options. More information about these API endpoints can be found at here.
touch_model_profile(model, data) delete_model_profile(model, profile) set_model_profile_opt(model, profile, key, value) delete_model_profile_opt(model, profile, key)touch_model_profile(model, data) delete_model_profile(model, profile) set_model_profile_opt(model, profile, key, value) delete_model_profile_opt(model, profile, key)
model |
Model digest or model name. |
data |
Data used for the body of the request. |
profile |
Profile name. |
key |
Option key. |
value |
Option value. |
A list from a JSON response object or nothing (invisibly).
## Not run: use_OpenMpp_local() touch_model_profile( "RiskPaths", list(Name = "profile1", Opts = list(Parameter.StartingSeed = "192")) ) delete_model_profile("RiskPaths", "profile1") ## End(Not run)## Not run: use_OpenMpp_local() touch_model_profile( "RiskPaths", list(Name = "profile1", Opts = list(Parameter.StartingSeed = "192")) ) delete_model_profile("RiskPaths", "profile1") ## End(Not run)
Register a connection to the OpenM++ Web Services (OMS) Application Programming Interface (API) running on the CPAC cloud-based server.
use_OpenMpp_CPAC( url = Sys.getenv("OPENMPP_CPAC_URL"), key = Sys.getenv("OPENMPP_CPAC_KEY"), ... )use_OpenMpp_CPAC( url = Sys.getenv("OPENMPP_CPAC_URL"), key = Sys.getenv("OPENMPP_CPAC_KEY"), ... )
url |
URL for making API requests. See |
key |
API Key for making requests. |
... |
Not currently used. |
An API key is sensitive information and should not be shared.
To avoid hard-coding your user name and password into your R scripts, we
recommend declaring this information in your global or project-specific
.Renviron file. The same approach may be used to declare
your URL for making API requests. While the URL us typically not
sensitive information, keeping all of this information in one place makes
sense for consistency. For remote API connections to CPAC, set the
following environment variables in your .Renviron files:
OPENMPP_CPAC_URL: URL for making remote API requests.
OPENMPP_CPAC_KEY: API key for making remote API requests.
Nothing, invisibly. Behind-the-scenes, an instance of the
OpenMppCPAC R6 class is created. This objects should not be accessed
directly by the user, instead, the package internally uses these
connections to communicate with the OpenM++ API.
## Not run: use_OpenMpp_CPAC() ## End(Not run)## Not run: use_OpenMpp_CPAC() ## End(Not run)
Register a custom connection to the OpenM++ Web Services (OMS) Application
Programming Interface (API). A custom conneciton is typically comprised of
two main tasks: (1) authentication and (2) building the request. To create
your own custom connection, you simply need to create a function (req)
that performs authentication (if needed) and builds the initial portion the
API request using the authentication information.
use_OpenMpp_custom(req, ...)use_OpenMpp_custom(req, ...)
req |
A function that that performs any required user authentication
with the API and builds the initial part of the API request
including handling the authentication. Calling |
... |
Not currently used. |
Nothing, invisibly. Behind-the-scenes, an instance of the
OpenMppCustom R6 class is created. These objects should not be accessed
directly by the user, instead, the package internally uses these
connections to communicate with the OpenM++ OMS API.
Register a local connection to the OpenM++ Web Services (OMS) Application Programming Interface (API). Currently, two different API connections "local" and "remote" are available. Note that "local" and "remote" describe where the API is running relative to the machine running the R session. Those who use a machine running on their local network may use a remote connection to connect with a cloud-based API, for example. Users running OpenM++ locally or who are logged into a remote virtual machine running OpenM++ will use the local API connection.
use_OpenMpp_local(url = Sys.getenv("OPENMPP_LOCAL_URL"), ...)use_OpenMpp_local(url = Sys.getenv("OPENMPP_LOCAL_URL"), ...)
url |
URL for making API requests. See |
... |
Not currently used. |
We recommend declaring the API URL in your global or
project-specific .Renviron file. For local and remote API connections,
set the following environment variable in your .Renviron files:
OPENMPP_LOCAL_URL: URL for a local API connection. Default is to use
http://localhost:4040.
Nothing, invisibly. Behind-the-scenes, an instance of the
OpenMppLocal R6 class is created. These objects should not be accessed
directly by the user, instead, the package internally uses these
connections to communicate with the OpenM++ API.
## Not run: use_OpenMpp_local() ## End(Not run)## Not run: use_OpenMpp_local() ## End(Not run)