Domino Data Lab APIs
API Endpoint
https://api.dominodatalab.com/Domino has two types of APIs: API Endpoints which let you publish your code as a low-latency web service without any API design experience and the Domino API which lets you allow you to interact with your project’s files and runs.
API Endpoints ¶
API Endpoints help you deploy and operationalize your models as APIs without any web development knowledge.
Your awesome model ¶
Headers
Content-Type: application/json
X-Domino-Api-Key: YOUR_DOMINO_API_KEYBody
{
"parameters": [
"Hello, world!"
]
}Headers
Content-Type: application/json
Domino-Deserialization-Time: 1
Domino-User-Code-Time: 10
Domino-Serialization-Time: 2Body
{
"release": {
"commitId": "e1dfab96a6c6014767e9561059224a3153cb6de6",
"file": "predict.R",
"function": "predictQuality",
"version": 14
},
"requestId": "NMEOMGVJURWVPOQF",
"result": {
"a_random_number": 103
}
}Your awesome modelPOST/v1/{username}/{project_name}/endpoint
Your API Endpoint is a wrapper on top of a function in your Domino-hosted code. The arguments to the API are the arguments to your function; the response from the API includes the return value from your function. Typically this function will make a prediction or classification given some input.
When the endpoint is published, Domino first runs the script containing the function. The process then waits for input (so any objects or functions from the script remain available in-memory). Each call to the endpoint runs the function within this same process. Because the script is only sourced once — at publish time — any more expensive initialization can happen up front, rather than happening on each call.
- username
string(required) Example: nickThe project owner’s username
- project_name
string(required) Example: winequalityThe project name
- parameters
arrayFor example, if your API endpoint is powered by the following function:
def random_number(start = 10, stop = 100): return random.uniform(start, stop)You would pass two number objects in to
parameters. The full JSON body would be:{"parameters": [20, 200] }
- release
objectAn object of key/value pairs describing the version of your API endpoint that responded to your request
- requestId
stringA unique request ID assigned to your API request
- result
objectThe result of the function you bound to your API Endpoint. Will be either a JSON object/dictionary or array depending on what your function returns.
Project Runs and Files ¶
These APIs allow you to interact with your project’s files and runs
List of Runs ¶
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEYHeaders
Content-Type: application/jsonBody
{
"objectType": "list",
"uri": "Hello, world!",
"data": [
{
"id": "57dafe43317467e7b0ef5276",
"projectId": "54c17e92e4b0bc49e27d9398",
"number": 5,
"startingUserId": "57a28b28961401f240812caf",
"queued": 1473969731915,
"started": 1473969754283,
"completed": 1473969762970,
"status": "Succeeded",
"commitId": "1c6e8aa47951e39f9a905f0077af9355c35b712b",
"executor": "us-west-2:i-007942020ce7baeb5",
"outputCommitId": "73fe9481fe635bada713246c3c739beefa424e8c",
"title": "Run with great R^2 of 1!",
"isArchived": false,
"postProcessedTimestamp": 1473969767822,
"diagnoisticStatistics": {
"isError": false,
"data": [
{
"key": "R^2",
"value": "1.000"
}
]
},
"isCompleted": true,
"hardwareTierId": "gpu"
}
]
}List of RunsGET/v1/projects/{username}/{project_name}/runs
Get a list of runs
- username
string(required) Example: nickThe project owner’s username
- project_name
string(required) Example: winequalityThe project name
- objectType
stringThe type of object the API returned
- uri
stringThe URI that responded to your request
- data
arrayArray of run statuses
Start Run ¶
Headers
Content-Type: application/json
X-Domino-Api-Key: YOUR_DOMINO_API_KEYBody
{
"command": [
"\"model.py\"",
"\"dataset\"",
"\"--sample\"",
"\"2000\""
],
"isDirect": false,
"title": "This one should work!",
"tier": "gpu",
"commitId": "1c6e8aa47951e39f9a905f0077af9355c35b712b",
"publishApiEndpoint": false
}Headers
Content-Type: application/jsonBody
{
"runId": "553af271e4b0364c0f717b24",
"message": "Run for project <username>/<project_name> started. You can view progress here: https://app.dominodatalab.com/<username>/<project_name/runs/553af271e4b0364c0f717b24"
}Start RunPOST/v1/projects/{username}/{project_name}/runs
Start a run of a given script or command
- username
string(required) Example: nickThe project owner’s username
- project_name
string(required) Example: winequalityThe project name
- command
arrayArray of strings making up your command. For example:
["model.py","dataset","--sample","2000"]- isDirect
booleana direct command is interpretted as a shell command; Domino doesn’t try to infer a program to match your file type
- title
stringan optional title for your run
- tier
stringname of the hardware tier to use
- commitId
stringrevision at which to start the run
- publishApiEndpoint
booleanIf true, the results of a successful run will be deployed to the project’s active API Endpoint, if one exists
- runId
stringThe unique ID for the run that was just started
- message
stringA human-readable message with a full link to view the status of your run
Run Status ¶
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEYHeaders
Content-Type: application/jsonBody
{
"id": "57dafe43317467e7b0ef5276",
"projectId": "54c17e92e4b0bc49e27d9398",
"number": 5,
"startingUserId": "57a28b28961401f240812caf",
"queued": 1473969731915,
"started": 1473969754283,
"completed": 1473969762970,
"status": "Succeeded",
"commitId": "1c6e8aa47951e39f9a905f0077af9355c35b712b",
"executor": "us-west-2:i-007942020ce7baeb5",
"outputCommitId": "73fe9481fe635bada713246c3c739beefa424e8c",
"title": "Run with great R^2 of 1!",
"isArchived": false,
"postProcessedTimestamp": 1473969767822,
"diagnoisticStatistics": {
"isError": false,
"data": [
{
"key": "R^2",
"value": "1.000"
}
]
},
"isCompleted": true,
"hardwareTierId": "gpu"
}Run StatusGET/v1/projects/{username}/{project_name}/runs/{run_id}
Get the status of a run
- username
string(required) Example: nickThe project owner’s username
- project_name
string(required) Example: winequalityThe project name
- run_id
string(required)The unique ID for the run
- id
stringThe unique ID for the run
- projectId
stringthe ID of the project
- number
numberthe auto-increment number associated with the run
- startingUserId
stringthe ID of the user who started the run
- queued
numbermilliseconds epoch time the run was added to the queue
- started
numbermilliseconds epoch time the run started executing
- completed
numbermilliseconds epoch time the run completed running
- status
stringthe status of the run
- commitId
stringthe commit hash of the project used to create the run
- executor
string- outputCommitId
stringthe commit hash of the project post-run (look at files with this hash for the results)
- title
stringtitle of the run, if it was renamed
- isArchived
booleanboolean denoting if the run was archived (hidden from the web interface)
- postProcessedTimestamp
numbermilliseconds epoch time the run finished processing (this happens after the run has completed and includes saving the results back to the main project repo)
- diagnoisticStatistics
object- isCompleted
boolean- hardwareTierId
stringThe hardware tier the run exectued on (new in v1.42)
List files ¶
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEYHeaders
Content-Type: application/jsonList filesGET/v1/projects/{username}/{project_name}/files/
Get a list of files in a commit
- username
string(required) Example: nickThe project owner’s username
- project_name
string(required) Example: winequalityThe project name
Get a file ¶
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEYGet a fileGET/v1/projects/{username}/{project_name}/blobs/{blob_id}
Get the contents of a file from the project
- username
string(required) Example: nickThe project owner’s username
- project_name
string(required) Example: winequalityThe project name
- blob_id
string(required) Example: adfjlklasdfhjklah8323hfjkdfThe unique ID of the blob
Upload a file ¶
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEYBody
<CONTENTS_OF_YOUR_FILE>Headers
Content-Type: application/json
Location: https://app.dominodatalab.com/v1/projects/marks/quick-start/blobs/5c28ab880e29953e41b91e351f786a833fbf18a5
Transfer-Encoding: chunkedBody
{
"path": "data/randomNumbers.rdata",
"lastModified": 1475878612000,
"size": 32690,
"key": "5c28ab880e29953e41b91e351f786a833fbf18a5",
"url": "https://app.dominodatalab.com/v1/projects/marks/quick-start/blobs/5c28ab880e29953e41b91e351f786a833fbf18a5"
}Upload a filePUT/v1/projects/{username}/{project_name}/{path}
Upload a file to your project
- username
string(required) Example: nickThe project owner’s username
- project_name
string(required) Example: winequalityThe project name
- path
string(required) Example: data/randomNumbers.rdataWhere you want the file to be saved. (You can include forward slashes to upload files into folders that exist)
- path
stringPath within the project your file was saved to
- lastModified
numberMilliseconds epoch time the file was last modified
- size
numberThe size of the file you just uploaded, in bytes
- key
stringThe blob ID for the file. Used by the ‘Get a file’ API
- url
stringThe full URL to the blob (this can be used to re-download the file)
Search ¶
These APIs allow you to interact search your projects, runs, files, and comments
Search ¶
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEYHeaders
Content-Type: application/jsonSearchGET/v1/search{?query,area}
Execute a search
- query
string(required) Example: shinyThe phrase to search
- area
string(required) Example: projectsThe type of object to search. Valid values are
project,run,file, andcomment
Generated by aglio on 30 Oct 2016