Learn R Programming

datarobot (version 2.18.9)

ConnectToDataRobot: Establish a connection to the DataRobot modeling engine

Description

This function initializes a DataRobot session. To use DataRobot, you must connect to your account. This can be done in three ways:

  • by passing an endpoint and token directly to ConnectToDataRobot

  • by having a YAML config file in $HOME/.config/datarobot/drconfig.yaml

  • by setting DATAROBOT_API_ENDPOINT and DATAROBOT_API_TOKEN environment variables

The three methods of authentication are given priority in that order (explicitly passing parameters to the function will trump a YAML config file, which will trump the environment variables), except where noted below for Certificate Authority (CA) bundle handling. If you have a YAML config file or environment variables set, you will not need to pass any parameters to ConnectToDataRobot in order to connect.

Usage

ConnectToDataRobot(
  endpoint = NULL,
  token = NULL,
  username = NULL,
  password = NULL,
  userAgentSuffix = NULL,
  sslVerify = TRUE,
  configPath = NULL,
  caBundle = NULL
)

Arguments

endpoint

character. URL specifying the DataRobot server to be used. It depends on DataRobot modeling engine implementation (cloud-based, on-prem...) you are using. Contact your DataRobot admin for endpoint to use and to turn on API access to your account. The endpoint for DataRobot cloud accounts is https://app.datarobot.com/api/v2

token

character. DataRobot API access token. It is unique for each DataRobot modeling engine account and can be accessed using DataRobot webapp in Account profile section.

username

character. No longer supported.

password

character. No longer supported.

userAgentSuffix

character. Additional text that is appended to the User-Agent HTTP header when communicating with the DataRobot REST API. This can be useful for identifying different applications that are built on top of the DataRobot Python Client, which can aid debugging and help track usage.

sslVerify

logical. Whether to check the SSL certificate. Either TRUE to check (default), FALSE to not check.

configPath

character. Path to YAML config file specifying configuration (token and endpoint).

caBundle

character. Path to a PEM-encoded Certificate Authority (CA) bundle file used to verify SSL/TLS connections. Useful when connecting to a DataRobot instance that uses a private or self-signed CA. When provided, this value is stored in the CURL_CA_BUNDLE environment variable and applied to all subsequent requests in the session. If NULL (the default), the value of CURL_CA_BUNDLE already present in the environment (if any) is preserved and used. Can also be set via ca_bundle in drconfig.yaml.

Details

A custom Certificate Authority (CA) bundle can be supplied in three equivalent ways:

  • Pass the path directly via the caBundle argument.

  • Set ca_bundle: /path/to/my.pem in your drconfig.yaml.

  • Export the CURL_CA_BUNDLE environment variable before starting R.

When both configPath and caBundle are supplied, the configuration file's ca_bundle entry takes precedence; the environment variable is consulted only when neither of the other surfaces provides a bundle. Unlike the other connection parameters, the CA bundle allows this layering instead of rejecting mixed inputs outright.

Examples

Run this code
if (FALSE) {
  ConnectToDataRobot("https://app.datarobot.com/api/v2", "thisismyfaketoken")
  ConnectToDataRobot(configPath = "~/.config/datarobot/drconfig.yaml")
  # Connect using a private CA bundle
  ConnectToDataRobot(
    endpoint = "https://app.datarobot.com/api/v2",
    token = "thisismyfaketoken",
    caBundle = "/path/to/my-ca-bundle.pem"
  )
}

Run the code above in your browser using DataLab