[Hawkular-dev] metrics: REST API evolution when querying for multiple metrics

Heiko W.Rupp hrupp at redhat.com
Wed Sep 14 10:02:29 EDT 2016


On 14 Sep 2016, at 10:57, Juraci Paixão Kröhling wrote:

> On 09/14/2016 10:52 AM, Heiko W.Rupp wrote:
>> Rest has content negotiation for this purpose.
>
> That implies that we'd make a special content type for the REST
> endpoints. From what I could see so far, our content-type is mostly
> application/json , so, do you mean we would have to change that to, say,
> application/json+metrics-x.y ?

I was a bit sloppy in my first reply here, but it is a pet-thingy of
mine to point out what REST offers :)

Yes, clients would need to request such a special content-type
I think most of the time it would be something like
application/json+hawkular-metrics;vX  where there is a
fallback to application/json+hawkular when there is no version
given. Old clients would just request application/json and get
what we server today.

The above only addresses the content submitted (Content-type header)
or received (Accepts header), but not changes in endpoints.

The later can be achieved by conditional redirects where the endpoint
looks at the content-type(s) and then sends a 302 to the new endpoint
accordingly.
New clients can directly use the new endpoint to circumvent the performance
hit of the redirect.


More information about the hawkular-dev mailing list