You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "haosdent (JIRA)" <ji...@apache.org> on 2015/08/01 20:09:04 UTC

[jira] [Updated] (MESOS-2257) Version the Operator/Admin API

     [ https://issues.apache.org/jira/browse/MESOS-2257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

haosdent updated MESOS-2257:
----------------------------
    Assignee:     (was: haosdent)

> Version the Operator/Admin API
> ------------------------------
>
>                 Key: MESOS-2257
>                 URL: https://issues.apache.org/jira/browse/MESOS-2257
>             Project: Mesos
>          Issue Type: Improvement
>            Reporter: Sunil Shah
>            Priority: Minor
>              Labels: mesosphere
>
> As a consumer of the Mesos HTTP API, it is necessary for us to determine the current version of Mesos so that we can parse the JSON documents returned correctly (since they change from version to version). 
> Currently we're doing this by fetching state.json, parsing it and pulling out the version field. A more idiomatic way to do this would be to filter on the content-type in the header itself.
> To give a more concrete example, currently the JSON documents returned by the HTTP API return the following headers:
> {code}
> HTTP/1.1 200 OK
> Date: Fri, 23 Jan 2015 21:31:37 GMT
> Content-Length: 9352
> Content-Type: application/json
> {code}
> Something like the following (e.g. for master/state.json) would be easy to switch upon:
> {code}
> HTTP/1.1 200 OK
> Date: Fri, 23 Jan 2015 21:31:37 GMT
> Content-Length: 9352
> Content-Type: application/vnd.mesos.master.state.v0.20.1+json; charset=utf-8
> {code}
> The vnd prefix is typically used for vendor specific file types (see: http://en.wikipedia.org/wiki/Internet_media_type#Prefix_vnd). Charset=utf-8 is required for JSON documents and is currently being omitted.
> This content-type would change for each document type, for example:
> {code}
> application/vnd.mesos.master.state.v0.20.1+json; charset=utf-8
> application/vnd.mesos.master.stats.v0.20.1+json; charset=utf-8
> application/vnd.mesos.slave.state.v0.20.1+json; charset=utf-8
> application/vnd.mesos.slave.stats.v0.20.1+json; charset=utf-8
> {code}
> Alternatively, the version could be appended as an extra field:
> {code}
> application/vnd.mesos.master.state+json; charset=utf-8; version=v0.20.1
> application/vnd.mesos.master.stats+json; charset=utf-8; version=v0.20.1
> application/vnd.mesos.slave.state+json; charset=utf-8; version=v0.20.1
> application/vnd.mesos.slave.stats+json; charset=utf-8; version=v0.20.1
> {code}
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)