Serve

ModelEndpoint

Create Manager

from terrene.enrich import ModelEndpointManager

manager = ModelEndpointManager(credentials=credentials, workspace=workspace)

Create

model = manager.create(
    name='my endpoint', description='a short description about my endpoint',
    enrich=predictive_model, store=warehouse, table='prediction')

Get

model = mananger.get('uuid')

Query

query_params = {
    'workspace__object_id': '',
    'name': '',
    'description': '',
    'workspace__name': '',
    'workspace__owners__object_id': '',
    'workspace__owners__email': '',
    'workspace__contributors__object_id': '',
    'workspace__contributors__email': ''
}
models = manger.query(query_params)

Update

model.name = 'new name'
model.save()

Predict

model.predict({'col1': 1, 'col2': 2})