Authenticating to DataRobot API
Various login credentials must be supplied to connect to the standard API and Prediction API of DataRobot.
Authenticating with a Login and API Key
Set the User and Password to your login credentials, and specify PredictionInstance. Additionally, set the APIKey connection property to your API Token, if you have obtained one already. If you are using a Cloud Prediction instance for DataRobot, you will need to supply DataRobotKey as well. To obtain the APIKey, follow the steps below:
- Login to the DataRobot UI, and click the person icon in the top right corner of the UI.
- From the drop down menu, select "Profile".
- Profile information will appear, including your "API Token".
To obtain the DataRobotKey, do the following:
- Login to the DataRobot UI, and click "Deployments" in the top-most toolbar.
- Open a deployment.
- In the deployment's menu, select the "Integrations" tab.
- Your DataRobotKey is the second entry in the
Connecting to DataRobot
To establish a connection to DataRobot, you will need to use the Login method.
To connect using the Login method, the following connection properties are required: User, Password, and PredictionInstance. DataRobotKey may also be required depending on your type of DataRobot predictions instance. APIUrl might also need to be set if connecting to an on-premise instance of DataRobot. If using the Predictions API, DataFile is required. It is expected that the CSV DataFile will include a header row as the first row of the datafile. DataFileEncoding should be used to specify the encoding of your DataFile if it is not UTF-8 encoded. APIKey is not required, but can be supplied. If not supplied, the driver will handle obtaining an APIKey.
User, Password, DataRobotKey, and APIKey are the credentials for the account to which you wish to connect the provider.
ProjectID, DataFile, and ModelId are the parameters for the project, dataset, and model that you would like to connect to. ProjectID and ModelId do not need to be specified. However, not specifying these connection properties will limit the tables and views exposed by the driver.
The driver supports executing SELECT queries against all of the DataRobot entities exposed in its data model.
Queries to Models and Projects will return information on one or many models or projects, depending on the WHERE clause used in your SELECT query. See the example queries below:
Queries to Predictions will submit the data in the file specified for DataFile to the DataRobot Prediction API for predictions scoring. When the predictions are returned from the Prediction API, the driver will join the predictions and corresponding data from DataFile into one table. Note that for the Predictions table to be exposed, both the ProjectID and ModelId connection properties must be specified.
Deployments will be dynamically exposed as tables. Similarly, starred models will be dynamically exposed if the ExposeStarredModels connection property is set and a ProjectID is specified. Queries to dynamically exposed deployments or starred models will return information on predictions using the project and model associated with that Deployment.
Customizing the SSL Configuration
By default, the provider attempts to negotiate SSL/TLS by checking the server's certificate against the system's trusted certificate store. To specify another certificate, see the SSLServerCert property for the available formats to do so.
Connecting Through a Firewall or Proxy
To connect through the Windows system proxy, you do not need to set any additional connection properties. To connect to other proxies, set ProxyAutoDetect to false.
In addition, to authenticate to an HTTP proxy, set ProxyAuthScheme, ProxyUser, and ProxyPassword, in addition to ProxyServer and ProxyPort.
Set the following properties:
- To use a proxy-based firewall, set FirewallType, FirewallServer, and FirewallPort.
- To tunnel the connection, set FirewallType to TUNNEL.
- To authenticate, specify FirewallUser and FirewallPassword.
- To authenticate to a SOCKS proxy, additionally set FirewallType to SOCKS5.
Troubleshooting the Connection
To show provider activity from query execution to network traffic, use Logfile and Verbosity. The examples of common connection errors below show how to use these properties to get more context. Contact the support team for help tracing the source of an error or circumventing a performance issue.
- Authentication errors: Typically, recording a Logfile at Verbosity 4 is necessary to get full details on an authentication error.
- Queries time out: A server that takes too long to respond will exceed the provider's client-side timeout. Often, setting the Timeout property to a higher value will avoid a connection error. Another option is to disable the timeout by setting the property to 0. Setting Verbosity to 2 will show where the time is being spent.
- The certificate presented by the server cannot be validated: This error indicates that the provider cannot validate the server's certificate through the chain of trust. If you are using a self-signed certificate, there is only one certificate in the chain.
To resolve this error, you must verify yourself that the certificate can be trusted and specify to the provider that you trust the certificate. One way you can specify that you trust a certificate is to add the certificate to the trusted system store; another is to set SSLServerCert.