Write Endpoints

Note that access to the Comet REST endpoints require the {'Authorization': ${COMET_REST_API_KEY}} header. To get your REST API key, see Comet Python API Setup.

Create Experiment

POST /api/rest/v2/write/experiment/create

Create an experiment.

Example Request

{
    "experimentName, optional": "someExperimentName",
    "projectName: required": "someProjectName",
    "workspaceName: required": "someTeamName"
}

Example Response

{
    "experimentKey": "someExperimentKey",
    "link": "link to experiment",
    "projectName": "someProjectName",
    "workspaceName": "someTeamName"
}

Stop Experiment

GET /api/rest/v2/write/experiment/stop?experimentKey=KEY

Stop an experiment.

Example Response

{
    "msg": "Stop Requested"
}

Archive Experiment

GET /api/rest/v2/write/experiment/archive?experimentKey=KEY

Archive an experiment.

Example Response

{
    "msg": "Archived"
}

Delete Experiment

GET /api/rest/v2/write/experiment/delete?experimentKey=KEY

Delete an experiment.

Example Response

{
    "msg": "Deleted"
}

Restore Experiment

GET /api/rest/v2/write/experiment/restore?experimentKey=KEY

Restore an experiment.

Example Response

{
    "msg": "Restore"
}

Create Project

POST /api/rest/v2/write/project/create

Create a project.

Example Request

{
    "isPublic: required": "[Boolean for whether the new project should be public]",
    "projectDescription: required": "someProjectDescription",
    "projectName: required": "someProjectName",
    "workspaceName: required": "someTeamName"
}

Example Response

{
    "projectId": "someProjectId"
}

Delete Project

POST /api/rest/v2/write/project/delete

Delete a project.

Example Request

{
    "deleteAllExperiments: required": "[Boolean for whether to also delete all the experiments in the project]",
    "projectName: required": "someProjectName",
    "workspaceName: required": "someTeamName"
}

Example Response

{
    "msg": "Deleted"
}

GET /api/rest/v2/write/project/symlink?exerimentKey=KEY&projectName=someProjectName

Add a symlink to an experiment.

Example Response

{
    "link": "symlink to experiment under the new project"
}

Update notes for Project

POST /api/rest/v2/write/project/notes

Update the notes for a project.

Example Request

{
    "notes: required": "someNotesString",
    "projectId: required": "someProjectId"
}

Example Response

{
    "msg": "Saved"
}

Send Experiment Keep-Alive Signal

GET /api/rest/v2/write/experiment/set-status?experimentKey=KEY

Send an experiment's keep-alive signal. The response tells the client how often to send the keep-alive signal, and how often to report CPU and GPU usage. Typically, a live experiment requests that the isAliveBeatDurationMillis is around 10 seconds, and an offline experiment requests about 10 minutes. In any event, the return status will send the suggested time intervals. The isAliveBeatDurationMillis determines when an experiment is no longer shown as processing in the frontend GUI.

Example Response

{
    "cpuMonitorIntervalMillis": 68000,
    "gpuMonitorIntervalMillis": 60000,
    "isAliveBeatDurationMillis": 10000
}

Set Experiment Start and End Time

POST /api/rest/v2/write/experiment/set-start-end-time

Set an experiment's start and end time.

Example Request

{
    "endTimeMillis, optional": "[Long milliseconds since the Epoch at experiment end]",
    "experimentKey: required": "someExperimentKey",
    "startTimeMillis, optional": "[Long milliseconds since the Epoch at experiment start]"
}

Example Response

{
    "msg": "Saved"
}

Log Other

POST /api/rest/v2/write/experiment/log-other

Log a key/value other data (not a metric, system, or parameter). Note that you can only retrieve others summary data (e.g., this is not recorded as a full time series).

Example Request

{
    "experimentKey: required": "someExperimentKey",
    "key: required": "someKey",
    "timestamp, optional": "[Long milliseconds since the Epoch]",
    "value: required": "someValue"
}

Example Response

{
    "msg": "Saved"
}

Log Parameter

POST /api/rest/v2/write/experiment/parameter

Log a parameter name and value. Note that you can only retrieve parameters summary data (e.g., this is not recorded as a full time series).

Example Request

{
    "experimentKey: required": "someExperimentKey",
    "parameterName: required": "someParamName",
    "parameterValue: required": "someParamValue",
    "step, optional": "[Long experiment step]",
    "timestamp: optional": "[Long milliseconds since the Epoch]"
}

Example Response

{
    "msg": "Saved"
}

Log Metric

POST /api/rest/v2/write/experiment/metric

Log a metric name and value. Metrics are the only items that are logged as a full time series. However, even metrics can be throttled if too much data (either by rate or by count) is attempted to be logged.

Example Request

{
    "context, optional": "someContext",
    "epoch, optional": "[Long experiment epoch]",
    "experimentKey: required": "someExperimentKey",
    "metricName: required": "someMetricName",
    "metricValue: required": "someMetricValue",
    "step, optional": "[Long experiment step]",
    "timestamp, optional": "[Long milliseconds since the Epoch]"
}

Example Response

{
    "msg": "Saved"
}

Set HTML

POST /api/rest/v2/write/experiment/html

Set (or append onto) an experiment's HTML.

Example Request

{
    "experimentKey: required": "someExperimentKey",
    "html: required": "someHtml",
    "override, optional": "[Boolean if true overwrite old html, if false append]",
    "timestamp: optional": "[Long milliseconds since the Epoch]"
}

Example Response

{
    "msg": "Saved"
}

Upload Asset

POST /api/rest/v2/write/experiment/upload-asset

Upload an asset.

Example Request

{
    "context, optional": "someContext",
    "experimentKey: required": "someExperimentKey",
    "extension, optional": "jpg",
    "fileName, optional": "myAsset.jpg",
    "metadata, optional": "[64 bit encoded metadata blob]",
    "overwrite, optional": "[Boolean should overwrite previous file of the same name]",
    "step, optional": "[Int step]",
    "type, optional": "someType"
}

Example Response

{
    "msg": "Saved"
}

Upload Text Sample

POST /api/rest/v2/write/experiment/upload-text-sample

Upload a text sample.

Example Request

{
    "apiKey": "someApiKey",
    "content": "The text sample",
    "context, optional": "someContext",
    "experimentKey: required": "someExperimentKey",
    "metadata, optional": "[64 bit encoded metadata blob]",
    "step, optional": "[Int step]"
}

Example Response

{
    "msg": "Saved"
}

Upload Git Patch

POST /api/rest/v2/write/experiment/git/patch

Upload a git patch for this experiment.

Example Request

{
    "experimentKey: required": "someExperimentKey"
}

Example Response

{
    "msg": "Saved"
}

Set System Details

POST /api/rest/v2/write/experiment/system-details

Set some or all of the system details.

Example Request

{
    "command, and arguments, optional, optional": [
        "myScript.py",
        "-arg",
        "theArgument"
    ],
    "executable": "/usr/local/bin/python",
    "experimentKey: required": "someExperimentKey",
    "gpuStaticInfoList, optional, optional": [
        {
            "gpuIndex: required": "[Int index]",
            "name: required": "gpu name",
            "powerLimit: required": "[Int gpu power limit]",
            "totalMemory: required": "[Int gpu total memory]",
            "uuid: required": "gpu uuid"
        }
    ],
    "hostname, optional": "someHostname",
    "installedPackages": [
        "an installed packages",
        "another installed package"
    ],
    "ip, optional": "someIp",
    "logAdditionalSystemInfoList": [
        {
            "key: required": "someKey",
            "value: required": "someValue"
        }
    ],
    "networkInterfaceIps, optional, optional": [
        "a network interface ip",
        "another network interface ip"
    ],
    "os, optional": "someOs",
    "osPackages, optional, optional": [
        "an os packages",
        "another os package"
    ],
    "osType, optional": "someOsType",
    "pid, optional": "[Int pid]",
    "pythonVersion, optional": "somePythonVersion",
    "pythonVersionVerbose, optional": "somePythonVersionVerbose",
    "user, optional": "someUser"
}

Example Response

{
    "msg": "Saved"
}

Set Git Metadata

POST /api/rest/v2/write/experiment/git/metadata

Set an experiment's git metadata.

Example Request

{
    "branch: required": "gitBranch",
    "experimentKey: required": "someExperimentKey",
    "origin: required": "gitOrigin",
    "parent: required": "gitParent",
    "root: required": "gitRoot",
    "user: required": "gitUser"
}

Example Response

{
    "msg": "Saved"
}

Log Output

POST /api/rest/v2/write/experiment/output

Log a line of standard output or standard error.

Example Request

{
    "context": "someContext",
    "experimentKey: required": "someExperimentKey",
    "outputLines, required: required": [
        {
            "localTimestamp": "[Long timestamp for this line of output]",
            "offset": "[Long used to order lines of output]",
            "output": "someOutput",
            "stderr": "[Boolean true is this was stdout, false if this was stderr]"
        }
    ]
}

Example Response

{
    "msg": "Saved"
}

Log Graph

POST /api/rest/v2/write/experiment/graph

Log an experiment's associated model graph.

Example Request

{
    "experimentKey": "someExperimentKey",
    "graph": "someGraph"
}

Example Response

{
    "msg": "Saved"
}

Set Code

POST /api/rest/v2/write/experiment/code

Set an experiment's associated source code.

Example Request

{
    "code": "someCode",
    "experimentKey": "someExperimentKey"
}

Example Response

{
    "msg": "Saved"
}

Add Tags

POST /api/rest/v2/write/experiment/tags

Add a list of tags to an experiment.

Example Request

{
    "addedTags, optional": [
        "someTag",
        "anotherTag"
    ],
    "experimentKey": "someExperimentKey"
}

Example Response

{
    "msg": "Saved"
}

Update Project

POST api/rest/v2/write/project/update?projectId=someProjectId
POST api/rest/v2/write/project/update?workspaceName=wsname&projectName=pname

Update a project's metadata. Either projectId should be non null, Or both projectName and workspaceName should be non null. They should not all be null or all be non null

Example Request

{
    "isPublic: optional": "[Boolean for whether the new project should be public]",
    "newProjectDescription: optional": "someProjectDescription",
    "newProjectName: optional": "someProjectDescription",
    "projectId": "someProjectId",
    "projectName": "someProjectName",
    "workspaceName": "someTeamName"
}

Example Response

{
    "msg": "Updated"
}

Add GPU Metrics

POST /api/rest/v2/write/experiment/gpu-metrics

Add an instance of GPU usage metrics.

Example Request

{
    "context: optional": "someContext",
    "epoch: optional": "[Long experiment epoch]",
    "experimentKey: required": "someExperimentKey",
    "gpus": [
        {
            "freeMemory: required": "[Long]",
            "gpuId: required": "[Int identifier]",
            "gpuUtilization: required": "[Int percentage utilization]",
            "totalMemory: required": "[Long]",
            "usedMemory: required": "[Long]"
        }
    ],
    "step: optional": "[Long experiment step]",
    "timestamp: optional": "[Long milliseconds since the Epoch]"
}

Example Response

{
    "msg": "Saved"
}

Add RAM Metrics

POST /api/rest/v2/write/experiment/ram-metrics

Add an instance of RAM usage metrics.

Example Request

{
    "context: optional": "someContext",
    "epoch: optional": "[Long experiment epoch]",
    "experimentKey: required": "someExperimentKey",
    "step: optional": "[Long experiment step]",
    "timestamp: optional": "[Long milliseconds since the Epoch]",
    "totalRam: required": "[Long]",
    "usedRam: required": "[Long]"
}

Example Response

{
    "msg": "Saved"
}

Add CPU Metrics

POST /api/rest/v2/write/experiment/ram-metrics

Add an instance of CPU usage metrics.

Example Request

{
    "context: optional": "someContext",
    "cpuPercentUtilization: required": [
        "12",
        "99",
        "[Int percentage, ordered by cpu]"
    ],
    "epoch: optional": "[Long experiment epoch]",
    "experimentKey: required": "someExperimentKey",
    "step: optional": "[Long experiment step]",
    "timestamp: optional": "[Long milliseconds since the Epoch]"
}

Example Response

{
    "msg": "Saved"
}

Add Processor Load Metrics

POST /api/rest/v2/write/experiment/load-metrics

Add an instance of processor load metrics.

Example Request

{
    "context: optional": "someContext",
    "epoch: optional": "[Long experiment epoch]",
    "experimentKey: required": "someExperimentKey",
    "loadAverage: required": "[Double]",
    "step: optional": "[Long experiment step]",
    "timestamp: optional": "[Long milliseconds since the Epoch]"
}

Example Response

{
    "msg": "Saved"
}

Save Store

POST /api/rest/v2/write/viz-instance/store/save;

Save an entire store.

Example Request

{
    "instanceId: required": "INSTANCE_ID",
    "projectId: required": "PROJECT_ID",
    "store: required": "\"{'store': '{key1: value1, ...}'}\""
}

Example Response

{
    "msg": "Stored"
}