ERA API

PYTHON SDK INSTALL

pip install https://era.dile.co/libs/v01/era_api.zip

Datasets

createDataset

Two-step operation to create a new dataset

Operation creates a dataset and returns a signed URL to upload file contents. Use the signed URL to POST the file contents into the server.


/datasets

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X POST "https://api.era.dile.co/v01/datasets"

from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)		

api.datasets.create('/path/to/file/data.csv',predict='variableName')						  
							  

Parameters

Header parameters
Name Description
x-api-key*
String
Required
Body parameters
Name Description
body *

Responses

Status: 200 - successful operation

Status: 400 - Error with parameters in body

Status: 403 - X-Api-Key needed

Status: 500 - System error


deleteDataset

Deletes a dataset


/datasets/{dataset_id}

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X DELETE "https://api.era.dile.co/v01/datasets/{dataset_id}"

from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)	

dataset_id = 'dddd-rrrr-tttt'

api.datasets.delete(dataset_id)						  
							  

Parameters

Path parameters
Name Description
dataset_id*
String
Dataset_id to delete
Required
Header parameters
Name Description
x-api-key*
String
Required

Responses

Status: 204 - Deleted succesfully

Status: 400 - Invalid ID supplied

Status: 403 - X-Api-Key needed

Status: 404 - Dataset not found

Status: 500 - System error


getDataset

Get a dataset given a dataset_id

Retrieves metadata of dataset with dataset_id and provides a signed URL to download the file.


/datasets/{dataset_id}

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X GET "https://api.era.dile.co/v01/datasets/{dataset_id}"

from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)

dataset_id = 'dddd-rrrr-tttt'

api.datasets.get(dataset_id)	

Parameters

Path parameters
Name Description
dataset_id*
String
Required
Header parameters
Name Description
x-api-key*
String
Required

Responses

Status: 200 - successful operation

Status: 400 - Error with parameters in body

Status: 403 - X-Api-Key needed

Status: 500 - System error


listDatasets

Get a list of datasets

Is a paginated operation that returns a list of datasets. Each page returns 10 items if available. If more items are available the response body will contain the next field. The next field can be used in the next query to retrieve the next page. The list can be filtered with the filename


/datasets

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X GET "https://api.era.dile.co/v01/datasets?next=&filename="

from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)					  
			  
api.datasets.list()				  
							  

Parameters

Header parameters
Name Description
x-api-key*
String
Required
Query parameters
Name Description
next
String
Use to retrieve 10 next items. Value is given in previous response body
filename
String
Use to filter name by filename. Can search by partial file names.

Responses

Status: 200 - successful operation

Status: 400 - Error with parameters in body

Status: 403 - X-Api-Key needed

Status: 500 - System error


Models

createModel

Operation to create a model

Start the model creation process using an existing dataset. If the dataset file has not been uploaded it will show “Error”. The parameter variable must be included if the dataset has undefined variables. To track the model creation progress use GET /models/:model_id route


/models

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X POST "https://api.era.dile.co/v01/models"

from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)					

dataset_id = 'dddd-rrrr-tttt'

api.models.create(dataset_id,'CLASSIFICATION')			  
							  

Parameters

Header parameters
Name Description
x-api-key*
String
Required
Body parameters
Name Description
body *

Responses

Status: 200 - successful operation

Status: 400 - Error with parameters in body

Status: 403 - X-Api-Key needed

Status: 500 - System error


deleteModel

Deletes a model


/models/{model_id}

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X DELETE "https://api.era.dile.co/v01/models/{model_id}"

from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)		

model_id = 'dddd-rrrr-tttt'

api.models.delete(model_id )						  
							  

Parameters

Path parameters
Name Description
model_id*
String
Model_id to delete
Required
Header parameters
Name Description
x-api-key*
String
Required

Responses

Status: 204 - Deleted succesfully

Status: 400 - Invalid ID supplied

Status: 403 - X-Api-Key needed

Status: 404 - Model not found

Status: 500 - System error


getModel

Get a model given a model_id

Retrieves metadata of model with model_id and provides information about processing status.The model status options are: initializing, processing, finished and error. While in processing status, a percentage of progress is provided. If status is finished, statistics about the model are exposed and the model will be ready to use for predictions.


/models/{model_id}

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X GET "https://api.era.dile.co/v01/models/{model_id}"

from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)

model_id = 'dddd-rrrr-tttt'

api.models.get(model_id )							  
							  

Parameters

Path parameters
Name Description
model_id*
String
Required
Header parameters
Name Description
x-api-key*
String
Required

Responses

Status: 200 - successful operation

Status: 202 - accepted operation, status report

Status: 400 - Error with parameters in body

Status: 403 - X-Api-Key needed

Status: 500 - System error


listModels

Get a list of models

Is a paginated operation that returns a list of models. Each page returns 10 items if available. If more items are available the response body will contain the next field. The next field can be used in the next query to retrieve the next page. The list can be filtered with the dataset filename


/models

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X GET "https://api.era.dile.co/v01/models?next=&filename="

from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)	

api.models.list( )						  
							  
							  

Parameters

Header parameters
Name Description
x-api-key*
String
Required
Query parameters
Name Description
next
String
Use to retrieve 10 next items. Value is given in previous response body
filename
String
Use to filter by dataset filename. Can search by partial file names.

Responses

Status: 200 - successful operation

Status: 400 - Error with parameters in body

Status: 403 - X-Api-Key needed

Status: 500 - System error


Precict

predictModel

Operation to create new predictions

Predicts using an already created model and new data. Resources should be started before calling this route


/predict

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X POST "https://api.era.dile.co/v01/predict"

from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)

model_id = 'xxxx-ssss-gggg'

data = [[1.1,1.2,5.4,3.2,2.0]]

api.resources.predict(model_id,data)							  
							  
							  

Parameters

Header parameters
Name Description
x-api-key*
String
Required
Body parameters
Name Description
body *

Responses

Status: 200 - successful operation

Status: 400 - Error with parameters in body

Status: 403 - X-Api-Key needed

Status: 500 - System error


Resources

getResourcesStatus

Requests computing resources status

Operation verifies resources associated with x-api-key profile. Operation returns resources status.


/resources

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X GET "https://api.era.dile.co/v01/resources"

from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)

api.resources.status()

Parameters

Header parameters
Name Description
x-api-key*
String
Required

Responses

Status: 200 - successful operation

Status: 403 - X-Api-Key needed

Status: 500 - System error


startResources

Requests the initialization of computing resources

Operation verifies resources associated with x-api-key profile. If resources are not started, the system starts computing resources. Operation returns resources status.


/resources

Usage and SDK Samples

curl  -H "X-Api-Key: YOUR_API_KEY " -H "Content-Type: application/json" -X POST "https://api.era.dile.co/v01/resources"
							  
from era_api import EraApi

API_KEY = 'YOUR_API_KEY'

api = EraApi(API_KEY)

api.resources.start()
							  
							  

Parameters

Header parameters
Name Description
x-api-key*
String
Required

Responses

Status: 200 - successful operation

Status: 403 - X-Api-Key needed

Status: 500 - System error