Created attachment 846008 [details] error message Description of problem: When I create a custom env variable via REST and then try to alter it using REST, I get the routing error. Then REST request which causes the error is: curl -k -X PUT https://ec2-75-101-181-228.compute-1.amazonaws.com/broker/rest/application/52ca7db613d6588c4a0000e7/environment-variables/foo --data-urlencode value=4444 -u ofayans:redhat Version-Release number of selected component (if applicable): AMI ID: ami-71370018 How reproducible: Always Steps to Reproduce: 1. Create an app 2. Create a custom env variable named foo: curl -k -X POST https://ec2-75-101-181-228.compute-1.amazonaws.com/broker/rest/application/52ca7db613d6588c4a0000e7/environment-variables --data-urlencode name=foo --data-urlencode value=1111 -u ofayans:redhat 3. try to alter it with the command listed in the problem description. Actual results: Routing error (see attachment) Expected results: env var is modified Additional info: I used the REST API guide available at http://docbuilder.usersys.redhat.com/17780/#Update_Environment_Variable
same problem with unsetting the env var: curl -k -X DELETE https://ec2-54-196-165-106.compute-1.amazonaws.com/broker/rest/application/52cd62f6f017aea3310002f6/environment-variables/foo fails to find corresponding route
@ofayans You need to change environment-variables to be environment-variable for PUT and DELETE I will transfer the bug to get the doc fixed. -Dan
Note: Also GET in the docs of a single variable should use the singular environment-variable.
Modified the path, now the response is as follows: $ curl -k -X PUT https://ec2-23-23-29-188.compute-1.amazonaws.com/broker/rest/application/52e7cd00a661de34c400025c/environment-variable/OPENSHIFT_DATA_DIR.json --data-urlencode value=1234 -u ofayans:redhat {"api_version":1.6,"data":null,"messages":[{"exit_code":189,"field":null,"index":null,"severity":"error","text":"Environment name 'OPENSHIFT_DATA_DIR' not found in application"}],"status":"not_found","supported_api_versions":[1.0,1.1,1.2,1.3,1.4,1.5,1.6],"type":null,"version":"1.6"} Should be exit_code 403 and error text something like: cannot be overridden
You can't modify system env vars with the api. Only user set env vars.
Agree, but let's at least make error message more meaningful. Because now it informs the user that there is no such ENV variable in the app, which is clearly not true
https://github.com/openshift/origin-server/pull/4615
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/1f7c77534c17fda73cc262295daf2b1e0df4cb53 Bug 1048758
Verified on devenv_4302 The messgae to the user is improved curl -s -k -H "content-type: application/json" -u jhou:redhat https://ec2-184-73-38-27.compute-1.amazonaws.com/broker/rest/application/52e9cc23444416b526000006/environment-variable/OPENSHIFT_DATA_DIR -X GET {"api_version":1.6,"data":null,"messages":[{"exit_code":189,"field":null,"index":null,"severity":"error","text":"User environment variable named 'OPENSHIFT_DATA_DIR' not found in application"}],"status":"not_found","supported_api_versions":[1.0,1.1,1.2,1.3,1.4,1.5,1.6],"type":null,"version":"1.6"}