Bug 1115244 - [origin_broker_241] Need to add 'region' as an optional_param to the 'ADD_APPLICATION' API instruction
Summary: [origin_broker_241] Need to add 'region' as an optional_param to the 'ADD_APP...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Master
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Ravi Sankar
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1116124 1116836
TreeView+ depends on / blocked
 
Reported: 2014-07-02 03:21 UTC by Jianwei Hou
Modified: 2015-05-15 00:56 UTC (History)
3 users (show)

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


Attachments (Terms of Use)

Description Jianwei Hou 2014-07-02 03:21:28 UTC
Description of problem:
We can create an app with a region using RESTAPI like:
curl -s -k -H 'Content-Type: Application/json' --user jhou:xxx https://ec2-54-196-70-231.compute-1.amazonaws.com/broker/rest/domains/jhou/applications/ -X POST -d '{"name":"php1s", "cartridge":"php-5.3", "scale":"true", "region":"region_2"}'

The new 'region' option is not added to our current API instruction, so the user may not be aware of this new function

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

How reproducible:
Always

Steps to Reproduce:
1. Call RESTAPI to retrieve domain info, there is an 'ADD_APPLICATION' link with all available options, but the supported region option is not listed.

Actual results:
"ADD_APPLICATION": {
                "href": "https://ec2-54-196-70-231.compute-1.amazonaws.com/broker/rest/domain/jhou/applications",
                "method": "POST",
                "optional_params": [
                    {
                        "default_value": null,
                        "description": "Array of one or more cartridge names",
                        "name": "cartridges",
                        "type": "array",
                        "valid_options": [

                        ]
                    },
                    {
                        "default_value": false,
                        "description": "Mark application as scalable",
                        "name": "scale",
                        "type": "boolean",
                        "valid_options": [
                            true,
                            false
                        ]
                    },
                    {
                        "default_value": "small",
                        "description": "The size of the gear",
                        "name": "gear_size",
                        "type": "string",
                        "valid_options": [
                            "small"
                        ]
                    },
                    {
                        "default_value": null,
                        "description": "A URL to a Git source code repository that will be the basis for this application.",
                        "name": "initial_git_url",
                        "type": "string",
                        "valid_options": [
                            "",
                            "empty"
                        ]
                    },
                    {
                        "default_value": null,
                        "description": "Name of a cartridge.",
                        "name": "cartridges[][name]",
                        "type": "string",
                        "valid_options": [

                        ]
                    },
                    {
                        "default_value": "small",
                        "description": "Gear size for the cartridge.",
                        "name": "cartridges[][gear_size]",
                        "type": "string",
                        "valid_options": [
                            "small"
                        ]
                    },
                    {
                        "default_value": null,
                        "description": "A URL to a downloadable cartridge. You may specify an multiple urls via {'cartridges' : [{'url':'http://...'}, ...]}",
                        "name": "cartridges[][url]",
                        "type": "string",
                        "valid_options": [

                        ]
                    },
                    {
                        "default_value": null,
                        "description": "Add or Update application environment variables, e.g.:[{'name':'FOO', 'value':'123'}, {'name':'BAR', 'value':'abc'}]",
                        "name": "environment_variables",
                        "type": "array",
                        "valid_options": [

                        ]
                    }
                ],


Expected results:
There should also be an option for setting region for the app

Additional info:

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

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

https://github.com/openshift/origin-server/commit/41098c5746efe83947a485cc99a0fe8efbfc7555
Bug 1115244 - Add 'region' as optional param to ADD_APPLICATION link

Comment 3 Jianwei Hou 2014-07-07 02:21:37 UTC
Verified on devenv_4940, this bug is fixed.

"ADD_APPLICATION": {
                "href": "https://ec2-54-196-162-245.compute-1.amazonaws.com/broker/rest/domain/jhou/applications",
                "method": "POST",
                "optional_params": [
                    {
                        "default_value": null,
                        "description": "Array of one or more cartridge names",
                        "name": "cartridges",
                        "type": "array",
                        "valid_options": [

                        ]
                    },
                    {
                        "default_value": false,
                        "description": "Mark application as scalable",
                        "name": "scale",
                        "type": "boolean",
                        "valid_options": [
                            true,
                            false
                        ]
                    },
                    {
                        "default_value": "small",
                        "description": "The size of the gear",
                        "name": "gear_size",
                        "type": "string",
                        "valid_options": [
                            "small"
                        ]
                    },
                    {
                        "default_value": null,
                        "description": "A URL to a Git source code repository that will be the basis for this application.",
                        "name": "initial_git_url",
                        "type": "string",
                        "valid_options": [
                            "",
                            "empty"
                        ]
                    },
                    {
                        "default_value": null,
                        "description": "Name of a cartridge.",
                        "name": "cartridges[][name]",
                        "type": "string",
                        "valid_options": [

                        ]
                    },
                    {
                        "default_value": "small",
                        "description": "Gear size for the cartridge.",
                        "name": "cartridges[][gear_size]",
                        "type": "string",
                        "valid_options": [
                            "small"
                        ]
                    },
                    {
                        "default_value": null,
                        "description": "A URL to a downloadable cartridge. You may specify an multiple urls via {'cartridges' : [{'url':'http://...'}, ...]}",
                        "name": "cartridges[][url]",
                        "type": "string",
                        "valid_options": [

                        ]
                    },
                    {
                        "default_value": null,
                        "description": "Add or Update application environment variables, e.g.:[{'name':'FOO', 'value':'123'}, {'name':'BAR', 'value':'abc'}]",
                        "name": "environment_variables",
                        "type": "array",
                        "valid_options": [

                        ]
                    },
                    {
                        "default_value": null,
                        "description": "Restrict application to the given region",
                        "name": "region",
                        "type": "string",
                        "valid_options": [

                        ]
                    }
                ],


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