Package com.datarobot.impl
Class DatasetClient
- java.lang.Object
-
- com.datarobot.impl.DatasetClient
-
- All Implemented Interfaces:
IDatasetClient,IDoGetCallback<Dataset>
public class DatasetClient extends java.lang.Object implements IDatasetClient, IDoGetCallback<Dataset>
TheDatasetClientobject provides access to the dataset endpoints of the DataRobot AI API. This object is not meant to be used directly but through theDataRobotAIClient.data()method.
-
-
Constructor Summary
Constructors Constructor Description DatasetClient(IDataRobotAIClient client)IDatasetClientbased API operations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(java.lang.String datasetId)Delete a datasetDatasetget(java.lang.String datasetId)Retrieve a datasetAction<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse>getHttpMessageTransformer()internalDatasetimportFile(java.lang.String sourceFile)Upload a new dataset.DatasetimportUrl(java.lang.String url)Import a dataset from a url.DatasetListlist()Retrieve a list of uploaded datasets associated with this accountDatasetListlist(PagingParams params)Retrieve a list of uploaded datasets associated with this accountDatasetListlist(java.lang.String aiId)Retrieve a list of uploaded datasets associated with this AIvoidsetHttpMessageTransformer(Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> httpMessageTransformer)internaljava.util.concurrent.Future<Dataset>startImportFile(java.lang.String fileName)Start the process of uploading a dataset from a local file.java.util.concurrent.Future<Dataset>startimportUrl(java.lang.String url)Start the process of uploading a dataset from a local file.java.lang.StringtoString()
-
-
-
Constructor Detail
-
DatasetClient
public DatasetClient(IDataRobotAIClient client)
IDatasetClientbased API operations. Users will not need to instantiate this object directly. It can be accessed throughDataRobotAIClient.data().- Parameters:
client-DataRobotAIClient
-
-
Method Detail
-
getHttpMessageTransformer
public Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> getHttpMessageTransformer()
internal- Specified by:
getHttpMessageTransformerin interfaceIDatasetClient
-
setHttpMessageTransformer
public void setHttpMessageTransformer(Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> httpMessageTransformer)
internal- Specified by:
setHttpMessageTransformerin interfaceIDatasetClient
-
importFile
public Dataset importFile(java.lang.String sourceFile) throws ClientException, java.io.FileNotFoundException, java.lang.InterruptedException
Upload a new dataset. See the Dataset page in the documentation for size limitations.- Specified by:
importFilein interfaceIDatasetClient- Parameters:
sourceFile- The path of the local file to upload- Returns:
- The new
Dataset - Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.java.io.FileNotFoundException- when a file with the specified pathname does not exist, or if the file does exist but is inaccessible for some reason.java.lang.InterruptedException- when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.
-
importUrl
public Dataset importUrl(java.lang.String url) throws ClientException, java.lang.InterruptedException
Import a dataset from a url. See the Dataset page in the documentation for size limitations.- Specified by:
importUrlin interfaceIDatasetClient- Parameters:
url- The url to a publicly available file- Returns:
- The new
Dataset - 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.
-
startImportFile
public java.util.concurrent.Future<Dataset> startImportFile(java.lang.String fileName) throws ClientException, java.io.FileNotFoundException
Start the process of uploading a dataset from a local file. This method can be used to avoid blocking during large file imports. See the Dataset page in the documentation for size limitations.- Specified by:
startImportFilein interfaceIDatasetClient- Parameters:
fileName- The path of the local file to upload- Returns:
FutureDataset- Throws:
java.io.FileNotFoundException- when a file with the specified pathname does not exist, or if the file does exist but is inaccessible for some reason.ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
startimportUrl
public java.util.concurrent.Future<Dataset> startimportUrl(java.lang.String url) throws ClientException
Start the process of uploading a dataset from a local file. This method can be used to avoid blocking during large file imports. See the Dataset page in the documentation for size limitations.- Specified by:
startimportUrlin interfaceIDatasetClient- Parameters:
url- The path of the url to be imported- Returns:
FutureDataset- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
list
public DatasetList list() throws ClientException
Retrieve a list of uploaded datasets associated with this account- Specified by:
listin interfaceIDatasetClient- Returns:
DatasetList- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
list
public DatasetList list(PagingParams params) throws ClientException
Retrieve a list of uploaded datasets associated with this account- Specified by:
listin interfaceIDatasetClient- Parameters:
params- ThePagingParamsobject for this list- Returns:
DatasetList- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
list
public DatasetList list(java.lang.String aiId) throws ClientException
Retrieve a list of uploaded datasets associated with this AI- Specified by:
listin interfaceIDatasetClient- Parameters:
aiId- Datasets for this AI will only be returned- Returns:
DatasetList- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
get
public Dataset get(java.lang.String datasetId) throws ClientException
Retrieve a dataset- Specified by:
getin interfaceIDatasetClient- Specified by:
getin interfaceIDoGetCallback<Dataset>- Parameters:
datasetId- The ID of the dataset to retrieve- Returns:
- The queried
Dataset - Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
delete
public void delete(java.lang.String datasetId) throws ClientExceptionDelete a dataset- Specified by:
deletein interfaceIDatasetClient- Parameters:
datasetId- The ID of the dataset to delete- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-