Register a connection to the OpenM++ 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. For example, users logged into the cloud-hosted RStudio Server sessions will acceess the API running locally. Those who use a machine running on their local network may use a remote connection to connect with the cloud-based API.
Usage
use_OpenMpp_local(url = Sys.getenv("OPENMPP_LOCAL_URL"), ...)
use_OpenMpp_remote(
url = Sys.getenv("OPENMPP_REMOTE_URL"),
user = Sys.getenv("OPENMPP_REMOTE_USER"),
pwd = Sys.getenv("OPENMPP_REMOTE_PWD"),
...
)
Value
Nothing, invisibly. Behind-the-scenes, an instance of the
OpenMppLocal
or OpenMppRemote
R6 classes are created. These
objects should not be accessed directly by the user, instead, the package
internally uses these connections to communicate with the OpenM++ API.
Details
A user
name and password (pwd
) are 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 URLs for making API requests. While these URLs are typically not
sensitive information, keeping all of this information in one place makes
sense for consistency. For local and remote API connections, set the
following environment variables in your .Renviron
files:
OPENMPP_LOCAL_URL
: URL for a local API connection.OPENMPP_REMOTE_URL
: URL for a remote API connection.OPENMPP_REMOTE_USER
: User name for logging into a remote API connection.OPENMPP_REMOTE_PWD
: Password for logging into a remote API connection.