Domino Data Lab APIs

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

POST https://api.dominodatalab.com//v1/nick/winequality/endpoint
Requestsexample 1
Headers
Content-Type: application/json
X-Domino-Api-Key: YOUR_DOMINO_API_KEY
Body
{
  "parameters": [
    "Hello, world!"
  ]
}
Responses200
Headers
Content-Type: application/json
Domino-Deserialization-Time: 1
Domino-User-Code-Time: 10
Domino-Serialization-Time: 2
Body
{
  "release": {
    "commitId": "e1dfab96a6c6014767e9561059224a3153cb6de6",
    "file": "predict.R",
    "function": "predictQuality",
    "version": 14
  },
  "requestId": "NMEOMGVJURWVPOQF",
  "result": {
    "a_random_number": 103
  }
}

Your awesome model
POST/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.


URI Parameters
HideShow
username
string (required) Example: nick

The project owner’s username

project_name
string (required) Example: winequality

The project name


Request Body Attributes
HideShow
parameters
array 

For 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] }

Response Body Attributes
HideShow
release
object 

An object of key/value pairs describing the version of your API endpoint that responded to your request

requestId
string 

A unique request ID assigned to your API request

result
object 

The 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

GET https://api.dominodatalab.com//v1/projects/nick/winequality/runs
Requestsexample 1
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEY
Responses200
Headers
Content-Type: application/json
Body
{
  "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 Runs
GET/v1/projects/{username}/{project_name}/runs

Get a list of runs


URI Parameters
HideShow
username
string (required) Example: nick

The project owner’s username

project_name
string (required) Example: winequality

The project name


Response Body Attributes
HideShow
objectType
string 

The type of object the API returned

uri
string 

The URI that responded to your request

data
array 

Array of run statuses



Start Run

POST https://api.dominodatalab.com//v1/projects/nick/winequality/runs
Requestsexample 1
Headers
Content-Type: application/json
X-Domino-Api-Key: YOUR_DOMINO_API_KEY
Body
{
  "command": [
    "\"model.py\"",
    "\"dataset\"",
    "\"--sample\"",
    "\"2000\""
  ],
  "isDirect": false,
  "title": "This one should work!",
  "tier": "gpu",
  "commitId": "1c6e8aa47951e39f9a905f0077af9355c35b712b",
  "publishApiEndpoint": false
}
Responses200
Headers
Content-Type: application/json
Body
{
  "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 Run
POST/v1/projects/{username}/{project_name}/runs

Start a run of a given script or command


URI Parameters
HideShow
username
string (required) Example: nick

The project owner’s username

project_name
string (required) Example: winequality

The project name


Request Body Attributes
HideShow
command
array 

Array of strings making up your command. For example: ["model.py","dataset","--sample","2000"]

isDirect
boolean 

a direct command is interpretted as a shell command; Domino doesn’t try to infer a program to match your file type

title
string 

an optional title for your run

tier
string 

name of the hardware tier to use

commitId
string 

revision at which to start the run

publishApiEndpoint
boolean 

If true, the results of a successful run will be deployed to the project’s active API Endpoint, if one exists


Response Body Attributes
HideShow
runId
string 

The unique ID for the run that was just started

message
string 

A human-readable message with a full link to view the status of your run



Run Status

GET https://api.dominodatalab.com//v1/projects/nick/winequality/runs/run_id
Requestsexample 1
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEY
Responses200
Headers
Content-Type: application/json
Body
{
  "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 Status
GET/v1/projects/{username}/{project_name}/runs/{run_id}

Get the status of a run


URI Parameters
HideShow
username
string (required) Example: nick

The project owner’s username

project_name
string (required) Example: winequality

The project name

run_id
string (required) 

The unique ID for the run


Response Body Attributes
HideShow
id
string 

The unique ID for the run

projectId
string 

the ID of the project

number
number 

the auto-increment number associated with the run

startingUserId
string 

the ID of the user who started the run

queued
number 

milliseconds epoch time the run was added to the queue

started
number 

milliseconds epoch time the run started executing

completed
number 

milliseconds epoch time the run completed running

status
string 

the status of the run

commitId
string 

the commit hash of the project used to create the run

executor
string 
outputCommitId
string 

the commit hash of the project post-run (look at files with this hash for the results)

title
string 

title of the run, if it was renamed

isArchived
boolean 

boolean denoting if the run was archived (hidden from the web interface)

postProcessedTimestamp
number 

milliseconds 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
string 

The hardware tier the run exectued on (new in v1.42)



List files

GET https://api.dominodatalab.com//v1/projects/nick/winequality/files/
Requestsexample 1
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEY
Responses200
Headers
Content-Type: application/json

List files
GET/v1/projects/{username}/{project_name}/files/

Get a list of files in a commit


URI Parameters
HideShow
username
string (required) Example: nick

The project owner’s username

project_name
string (required) Example: winequality

The project name



Get a file

GET https://api.dominodatalab.com//v1/projects/nick/winequality/blobs/adfjlklasdfhjklah8323hfjkdf
Requestsexample 1
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEY
Responses200
This response has no content.

Get a file
GET/v1/projects/{username}/{project_name}/blobs/{blob_id}

Get the contents of a file from the project


URI Parameters
HideShow
username
string (required) Example: nick

The project owner’s username

project_name
string (required) Example: winequality

The project name

blob_id
string (required) Example: adfjlklasdfhjklah8323hfjkdf

The unique ID of the blob



Upload a file

PUT https://api.dominodatalab.com//v1/projects/nick/winequality/data/randomNumbers.rdata
Requestsexample 1
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEY
Body
<CONTENTS_OF_YOUR_FILE>
Responses201
Headers
Content-Type: application/json
Location: https://app.dominodatalab.com/v1/projects/marks/quick-start/blobs/5c28ab880e29953e41b91e351f786a833fbf18a5
Transfer-Encoding: chunked
Body
{
  "path": "data/randomNumbers.rdata",
  "lastModified": 1475878612000,
  "size": 32690,
  "key": "5c28ab880e29953e41b91e351f786a833fbf18a5",
  "url": "https://app.dominodatalab.com/v1/projects/marks/quick-start/blobs/5c28ab880e29953e41b91e351f786a833fbf18a5"
}

Upload a file
PUT/v1/projects/{username}/{project_name}/{path}

Upload a file to your project


URI Parameters
HideShow
username
string (required) Example: nick

The project owner’s username

project_name
string (required) Example: winequality

The project name

path
string (required) Example: data/randomNumbers.rdata

Where you want the file to be saved. (You can include forward slashes to upload files into folders that exist)


Response Body Attributes
HideShow
path
string 

Path within the project your file was saved to

lastModified
number 

Milliseconds epoch time the file was last modified

size
number 

The size of the file you just uploaded, in bytes

key
string 

The blob ID for the file. Used by the ‘Get a file’ API

url
string 

The full URL to the blob (this can be used to re-download the file)



GET https://api.dominodatalab.com//v1/search?query=shiny&area=projects
Requestsexample 1
Headers
X-Domino-Api-Key: YOUR_DOMINO_API_KEY
Responses200
Headers
Content-Type: application/json

Search
GET/v1/search{?query,area}

Execute a search


URI Parameters
HideShow
query
string (required) Example: shiny

The phrase to search

area
string (required) Example: projects

The type of object to search. Valid values are project, run, file, and comment



Generated by aglio on 30 Oct 2016