Bug 1115274 - [origin_broker_241] RESTAPI can not show which region is the default
Summary: [origin_broker_241] RESTAPI can not show which region is the default
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ravi Sankar
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1116124 1116836
TreeView+ depends on / blocked
 
Reported: 2014-07-02 06:10 UTC by Jianwei Hou
Modified: 2015-05-15 00:29 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-10 00:48:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jianwei Hou 2014-07-02 06:10:33 UTC
Description of problem:
Call RESTAPI to list all regions, the value of 'default' of the default region is shown as 'false' when it should be 'true'. 

Version-Release number of selected component (if applicable):
devenv_4932

How reproducible:
Always

Steps to Reproduce:
1. Create 2 regions with oo-admin-ctl-region
2. Set one region as default in broker-dev.conf, restart broker service
[root@ip-10-231-164-224 ~]# tail -n 1 /etc/openshift/broker-dev.conf
DEFAULT_REGION_ID="region_1"

3. Call RESTAPI to list all regions
curl -s -k -H 'Content-Type: Application/json' https://ec2-54-196-70-231.compute-1.amazonaws.com/broker/rest/regions -X GET

Actual results:
After step 3: The values of 'default' of all regions are 'false', as a consequence, the end user has no way to know which one is default

"data": [
        {
            "default": false,
            "id": "53b3a8bf8fbc0995b0000001",
            "name": "region_1",
            "zones": [
                {
                    "_id": "53b3a9591c79cb4e2b000001",
                    "_type": null,
                    "created_at": "2014-07-02T06:40:25Z",
                    "name": "zone_1",
                    "updated_at": "2014-07-02T06:40:25Z"
                }
            ]
        },
        {
            "default": false,
            "id": "53b3ab78924d888611000001",
            "name": "region_2",
            "zones": [

            ]
        }
    ],


Expected results:
region_1 is the default region, so it should have:
'default': true

Additional info:

Comment 1 Ravi Sankar 2014-07-03 07:48:25 UTC
Fixed in https://github.com/openshift/li/pull/2733

Comment 2 openshift-github-bot 2014-07-03 15:39:54 UTC
Commit pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/6f3b7f26ecfaaf31a8d48733847ea4d9d5c2eb0f
Bug 1115274 - Fix 'default' field in /regions REST api

Comment 3 openshift-github-bot 2014-07-03 15:40:01 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/0598d3648d0e33052970a83a229296f9cb6396ab
Bug 1115274 - Fix 'default' field in /regions REST api

Comment 4 Jianwei Hou 2014-07-07 02:33:55 UTC
Verified on devenv_4940, the default region can be shown properly

{
    "api_version": 1.7,
    "data": [
        {
            "default": true,
            "id": "53ba3d321b5cd03c51000001",
            "name": "region_1",
            "zones": [

            ]
        },
        {
            "default": false,
            "id": "53ba3d49e3afb83cfc000001",
            "name": "region_2",
            "zones": [

            ]
        }
    ],
    "messages": [
        {
            "exit_code": 0,
            "field": null,
            "index": null,
            "severity": "info",
            "text": "Listing 2 region(s)"
        }
    ],
    "status": "ok",
    "supported_api_versions": [
        1.0,
        1.1,
        1.2,
        1.3,
        1.4,
        1.5,
        1.6,
        1.7
    ],
    "type": "regions",
    "version": "1.7"
}


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