Bug 961475 - When we update to REST API 1.5, switch the "version" attribute to be a float
When we update to REST API 1.5, switch the "version" attribute to be a float
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Master (Show other bugs)
2.x
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Lili Nader
libra bugs
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-09 13:05 EDT by Clayton Coleman
Modified: 2015-05-14 20:54 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-11 00:02:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Clayton Coleman 2013-05-09 13:05:26 EDT
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 13:47:23 EDT
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 17:21:48 EDT
Created a US in trello for remaining tasks

https://trello.com/c/HYiLhcT3
Comment 5 Rony Gong 2013-05-23 02:00:11 EDT
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@redhat.com: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.