[
https://issues.jboss.org/browse/JBIDE-15766?page=com.atlassian.jira.plugi...
]
Andre Dietisheim commented on JBIDE-15766:
------------------------------------------
here's what ffranz did to demostrate that it should work:
{code}
curl -k --user user:pass
https://openshift.redhat.com/broker/rest/domain/ffranz/application/commaf...
-d environment_variables[][name]=NAME -d environment_variables[][name]=NAME2 -d
environment_variables[][value]=VALUE2 -d environment_variables[][name]=NAME3 -d
environment_variables[][value]=VALUE3 --header "Accept: application/json;
version=1.2" | json
{code}
which returns that the env vars were "patched" (see messages):
{code}
{
"api_version": 1.2,
"data": [
{
"links": {
"GET": {
"href":
"https://openshift.redhat.com/broker/rest/domain/ffranz/application/commafeed/environment-variable/NAME2",
"method": "GET",
"optional_params": [],
"rel": "Get environment variable",
"required_params": []
},
"UPDATE": {
"href":
"https://openshift.redhat.com/broker/rest/domain/ffranz/application/commafeed/environment-variable/NAME2",
"method": "PUT",
"optional_params": [],
"rel": "Update environment variable",
"required_params": [
{
"description": "Value of the environment variable",
"invalid_options": [],
"name": "value",
"type": "string",
"valid_options": []
}
]
},
"DELETE": {
"href":
"https://openshift.redhat.com/broker/rest/domain/ffranz/application/commafeed/environment-variable/NAME2",
"method": "DELETE",
"optional_params": [],
"rel": "Delete environment variable",
"required_params": []
}
},
"name": "NAME2",
"value": "VALUE2"
},
{
"links": {
"GET": {
"href":
"https://openshift.redhat.com/broker/rest/domain/ffranz/application/commafeed/environment-variable/NAME3",
"method": "GET",
"optional_params": [],
"rel": "Get environment variable",
"required_params": []
},
"UPDATE": {
"href":
"https://openshift.redhat.com/broker/rest/domain/ffranz/application/commafeed/environment-variable/NAME3",
"method": "PUT",
"optional_params": [],
"rel": "Update environment variable",
"required_params": [
{
"description": "Value of the environment variable",
"invalid_options": [],
"name": "value",
"type": "string",
"valid_options": []
}
]
},
"DELETE": {
"href":
"https://openshift.redhat.com/broker/rest/domain/ffranz/application/commafeed/environment-variable/NAME3",
"method": "DELETE",
"optional_params": [],
"rel": "Delete environment variable",
"required_params": []
}
},
"name": "NAME3",
"value": "VALUE3"
}
],
"messages": [
{
"exit_code": 0,
"field": null,
"index": null,
"severity": "info",
"text": "Patched environment variables for application
commafeed"
}
],
"status": "created",
"supported_api_versions": [
1,
1.1,
1.2,
1.3,
1.4,
1.5,
1.6
],
"type": "environment-variables",
"version": "1.2"
}
{code}
openshift-java-client: dont refresh env variables on each
addition/removal
--------------------------------------------------------------------------
Key: JBIDE-15766
URL:
https://issues.jboss.org/browse/JBIDE-15766
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: openshift
Affects Versions: 4.1.1.Beta1, 4.2.0.Alpha1
Reporter: Andre Dietisheim
Assignee: Andre Dietisheim
Fix For: 4.1.1.Beta1, 4.2.0.Alpha1
When adding/removing environment variables, the openshift-java-client would always
request the backend for the full list. This should not be required and avoided
{code:title=ApplicationResource#addEnvironmentVariable}
EnvironmentVariableResourceDTO environmentVariableResourceDTO =
new AddEnvironmentVariableRequest().execute(name, value);
IEnvironmentVariable environmentVariable = new
EnvironmentVariableResource(environmentVariableResourceDTO, this);
updateEnvironmentVariables();
return environmentVariable;
{code}
{code:title=ApplicationResource#updateEnvironmentVariables}
protected void updateEnvironmentVariables() throws OpenShiftException {
if (environmentVariableByName == null) {
environmentVariableByName = loadEnvironmentVariables();
} else {
environmentVariableByName.clear();
environmentVariableByName.putAll(loadEnvironmentVariables());
}
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira