Bug 961475 - When we update to REST API 1.5, switch the "version" attribute to be a float
Summary: When we update to REST API 1.5, switch the "version" attribute to be a float
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Master
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Lili Nader
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-09 17:05 UTC by Clayton Coleman
Modified: 2015-05-15 00:54 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-11 04:02:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Clayton Coleman 2013-05-09 17:05:26 UTC
Today, the "supported_api_versions" attribute is an array of floats, and the "version" attribute is a string.  This is bad for comparison purposes and for other operations.  Starting in the next major API version, we should communicate with our developers that "version" will be changed to a float instead of a string, and that they should react accordingly.

We should investigate the impact this may have on older, non version locked clients (older versions of RHC before 1.3) and any other major non version locked integrator.

Comment 1 Lili Nader 2013-05-16 17:47:23 UTC
This change will make sure the next version will respond with version in float.  It also protects any clients using versions =<1.4 by returning a string.

https://github.com/lnader/origin-server/commit/7df848b3e12548396337d49e8a30d858d937ee57

Older RHC clients should be protected by this code in broker that we put in place in 1.4.

origin-server/controller/lib/openshift/controller/api_behavior.rb:31
version = 1.3 if request.headers['User-Agent'].present? and request.headers['User-Agent'].start_with? "rhc"

This change will take affect when we move to version 1.5.  I will make a separate commit for changing current version from 1.4 => 1.5 after we have decided how to communicate the change to our developers.

Comment 4 Lili Nader 2013-05-20 21:21:48 UTC
Created a US in trello for remaining tasks

https://trello.com/c/HYiLhcT3

Comment 5 Rony Gong 🔥 2013-05-23 06:00:11 UTC
Verified on devenv_3261
All API versions (1.0,1.1,1.2,1.3,1.4) now returned as string temporarily.

curl -k -X GET -H 'Accept: application/json, version=1.1' --user qgong:111111 https://ec2-23-21-31-195.compute-1.amazonaws.com/broker/rest/api |json_reformat
.......

  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4
  ],
  "type": "links",
  "version": "1.0" 

  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4
  ],
  "type": "links",
  "version": "1.1"

  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4
  ],
  "type": "links",
  "version": "1.2"

  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4
  ],
  "type": "links",
  "version": "1.3"

  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4
  ],
  "type": "links",
  "version": "1.4"


Note You need to log in before you can comment on or make changes to this bug.