janelia-flyem / dvid

Distributed, Versioned, Image-oriented Dataservice
http://dvid.io
Other
196 stars 33 forks source link

Endpoint to query body MutationID #258

Closed stuarteberg closed 6 years ago

stuarteberg commented 6 years ago

It would be useful if clients could fetch a body's current MutationID (which is normally set via cleaves and merges.

For instance, if a cleave is computed for a particular body, but not applied to DVID right away, we could store the body's mutation ID at the time the cleave was computed. When we finally apply the cleave to DVID, we can abort if the mutation ID has changed in the meantime.

DocSavage commented 6 years ago

I've added a GET /lastmod/<label> endpoint to labelmap. It will return last modification metadata in JSON:

GET <api URL>/node/<UUID>/<data name>/lastmod/<label>

    Returns last modification metadata for a label in JSON:

    { "mutation id": 2314, "last mod user": "johndoe", "last mod time": "2000-02-01 12:13:14 +0000 UTC", "last mod app": "Neu3" }

    Time is returned in RFC3339 string format. Returns a status code 404 (Not Found)
    if label does not exist.

    Arguments:
    UUID          Hexidecimal string with enough characters to uniquely identify a version node.
    data name     Name of labelmap instance.
    label         A 64-bit integer label id