Bug 981283 - Contents of ADD_CARTRIDGE got messed under applications/<app_name>/cartridges
Contents of ADD_CARTRIDGE got messed under applications/<app_name>/cartridges
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Master (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Lili Nader
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-04 07:28 EDT by Meng Bo
Modified: 2015-05-14 20:55 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-22 11:21:25 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 Meng Bo 2013-07-04 07:28:38 EDT
Description of problem:
When trying to find the method to add cartridge to app via REST API, found the usage of ADD_CARTRIDGE makes me confusing.

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

How reproducible:
always

Steps to Reproduce:
1.Trying to find the method to add cartridge to app via REST API
$curl -k -H 'Accept: application/json' --user bmeng@redhat.com:123123 https://ec2-54-234-3-195.compute-1.amazonaws.com/broker/rest/domains/bmengdev/applications/py27/ |json_reformat


Actual results:
1. The "name" field under required_param has value "name", but we cannot add cartridge with "-d name=xxx", the correct value should be "cartridge"
2. The "additional_storage" "scales_from" "scales_to" are listed under the optional_param, but they cannot be performed when adding cartridge.


Expected results:
User can get the correct method to do operation via REST API.


Additional info:
$curl -k -H 'Accept: application/json' --user bmeng@redhat.com:123123 https://ec2-54-234-3-195.compute-1.amazonaws.com/broker/rest/domains/bmengdev/applications/py27/ |json_reformat
<-----snip>
            "ADD_CARTRIDGE": {
                "href": "https://ec2-54-234-3-195.compute-1.amazonaws.com/broker/rest/domains/bmengdev/applications/py27/cartridges",
                "method": "POST",
                "optional_params": [
                    {
                        "default_value": null,
                        "description": "The component to colocate with",
                        "name": "colocate_with",
                        "type": "string",
                        "valid_options": [
                            "python-2.7",
                            "mysql-5.1",
                            "mongodb-2.2",
                            "postgresql-8.4"
                        ]
                    },
                    {
                        "default_value": null,
                        "description": "Minimum number of gears to run the component on.",
                        "name": "scales_from",
                              ^^^^^^^^^^^^^^^^^
                        "type": "integer",
                        "valid_options": [

                        ]
                    },
                    {
                        "default_value": null,
                        "description": "Maximum number of gears to run the component on.",
                        "name": "scales_to",
                          ^^^^^^^^^^^^^^^^^^^^^^^
                        "type": "integer",
                        "valid_options": [

                        ]
                    },
                    {
                        "default_value": null,
                        "description": "Additional GB of space to request on all gears running this component.",
                        "name": "additional_storage",
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        "type": "integer",
                        "valid_options": [

                        ]
                    },
                    {
                        "default_value": null,
                        "description": "A URL to a downloadable cartridge.",
                        "name": "url",
                        "type": "string",
                        "valid_options": [

                        ]
                    }
                ],
                "rel": "Add embedded cartridge",
                "required_params": [
                    {
                        "description": "framework-type, e.g.: mongodb-2.0",
                        "invalid_options": [

                        ],
                        "name": "name",                 <<----------------
                        "type": "string",
                        "valid_options": [
                            "10gen-mms-agent-0.1",
                            "cron-1.4",
                            "haproxy-1.4",
                            "jenkins-client-1.4",
                            "metrics-0.1",
                            "mock-plugin-0.1",
                            "mongodb-2.2",
                            "mysql-5.1",
                            "phpmyadmin-3.4",
                            "postgresql-8.4",
                            "postgresql-9.2",
                            "rockmongo-1.1",
                            "switchyard-0.6"
                        ]
                    }
                ]
            },
Comment 1 Lili Nader 2013-07-09 13:45:28 EDT
I don't understand why this is a bug.

Actual results:
1. The "name" field under required_param has value "name", but we cannot add cartridge with "-d name=xxx", the correct value should be "cartridge"

Lili: Works for me.


2. The "additional_storage" "scales_from" "scales_to" are listed under the optional_param, but they cannot be performed when adding cartridge.

Lili:Works for me.

Please give an actual example were this API is not working.
Comment 2 Meng Bo 2013-07-10 04:32:55 EDT
That works for me from my side too...

Not sure what happened when I reporting this bug.

Move to verified. Thanks.

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