Bug 961475

Summary: When we update to REST API 1.5, switch the "version" attribute to be a float
Product: OpenShift Online Reporter: Clayton Coleman <ccoleman>
Component: MasterAssignee: Lili Nader <lnader>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.xCC: mfisher, qgong
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-11 04:02:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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"