Package com.datarobot.impl
Class DataRobotAIClient
- java.lang.Object
-
- com.datarobot.impl.DataRobotAIClient
-
- All Implemented Interfaces:
IDataRobotAIClient
public class DataRobotAIClient extends java.lang.Object implements IDataRobotAIClient
TheDataRobotAIClientobject is the main class for using the DataRobot AI API.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBASE_URLThe base URLstatic java.lang.StringCLIENT_VERSIONThe current version of the client
-
Constructor Summary
Constructors Constructor Description DataRobotAIClient()Create a new instance of theDataRobotAIClientfrom anAPI_KEYenvironment variableDataRobotAIClient(java.lang.String key)Create a new instance of theDataRobotAIClientDataRobotAIClient(java.lang.String key, java.lang.String endpoint)Create a new instance of theDataRobotAIClientDataRobotAIClient(java.lang.String key, java.lang.String endpoint, com.google.api.client.http.HttpTransport httpTransport)Internal provided for testing use only
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IAIClientais()IAIClientbased API operationsAIcreateAI(java.lang.String name)Create an AI that will learn from past data to predict on new data.IDatasetClientdata()IDatasetClientbased API operationsjava.lang.StringgetApiKey()The currently configured API key used by this instance of the client.java.lang.StringgetConfiguredUrl()Gets the URL endpoint the client is currently connected to.ApiConnectiongetConnection()Internal Returns the HTTP connection used for all calls in the client.Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse>getHttpMessageTransformer()InternalILearningSessionClientlearning()ILearningSessionClientbased API operationsPingping()InternalIPredictionClientpredictions()IPredictionClientbased API operationsvoidsetHttpMessageTransformer(Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> httpMessageTransformer)InternalIStatusClientstatus()IStatusClientbased API operationsjava.lang.StringtoString()
-
-
-
Field Detail
-
CLIENT_VERSION
public static final java.lang.String CLIENT_VERSION
The current version of the client- See Also:
- Constant Field Values
-
BASE_URL
public static final java.lang.String BASE_URL
The base URL- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DataRobotAIClient
public DataRobotAIClient()
Create a new instance of theDataRobotAIClientfrom anAPI_KEYenvironment variable
-
DataRobotAIClient
public DataRobotAIClient(java.lang.String key)
Create a new instance of theDataRobotAIClient- Parameters:
key- The API Key from your account
-
DataRobotAIClient
public DataRobotAIClient(java.lang.String key, java.lang.String endpoint)Create a new instance of theDataRobotAIClient- Parameters:
key- The API Key from your accountendpoint- The URL this client will connect tos
-
DataRobotAIClient
public DataRobotAIClient(java.lang.String key, java.lang.String endpoint, com.google.api.client.http.HttpTransport httpTransport) throws java.lang.IllegalArgumentExceptionInternal provided for testing use only- Throws:
java.lang.IllegalArgumentException
-
-
Method Detail
-
getApiKey
public java.lang.String getApiKey()
The currently configured API key used by this instance of the client.- Returns:
- The currently configured API Key.
-
getConfiguredUrl
public java.lang.String getConfiguredUrl()
Gets the URL endpoint the client is currently connected to.- Returns:
- the URL of the DataRobot AI API that is currently being used.
-
getConnection
public ApiConnection getConnection()
Internal Returns the HTTP connection used for all calls in the client.- Specified by:
getConnectionin interfaceIDataRobotAIClient- Returns:
- The HTTP connection used for all calls in the client.
-
getHttpMessageTransformer
public Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> getHttpMessageTransformer()
Internal- Specified by:
getHttpMessageTransformerin interfaceIDataRobotAIClient
-
setHttpMessageTransformer
public void setHttpMessageTransformer(Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> httpMessageTransformer)
Internal- Specified by:
setHttpMessageTransformerin interfaceIDataRobotAIClient
-
data
public IDatasetClient data()
IDatasetClientbased API operations- Specified by:
datain interfaceIDataRobotAIClient
-
status
public IStatusClient status()
IStatusClientbased API operations- Specified by:
statusin interfaceIDataRobotAIClient
-
predictions
public IPredictionClient predictions()
IPredictionClientbased API operations- Specified by:
predictionsin interfaceIDataRobotAIClient
-
ais
public IAIClient ais()
IAIClientbased API operations- Specified by:
aisin interfaceIDataRobotAIClient
-
learning
public ILearningSessionClient learning()
ILearningSessionClientbased API operations- Specified by:
learningin interfaceIDataRobotAIClient
-
ping
public Ping ping() throws ClientException
Internal- Specified by:
pingin interfaceIDataRobotAIClient- Returns:
- Returns a
Pingobject that will contain 'Pong' if connection was successful. - Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
createAI
public AI createAI(java.lang.String name) throws ClientException, java.lang.InterruptedException
Create an AI that will learn from past data to predict on new data. Note aAIcan be sometimes referred to as an AI.- Specified by:
createAIin interfaceIDataRobotAIClient- Parameters:
name- The name of the AI- Returns:
AI- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.java.lang.InterruptedException- when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-