[JBoss JIRA] (JBIDE-15766) openshift-java-client: dont refresh env variables on each addition/removal
by Andre Dietisheim (JIRA)
[ 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/commaf...",
"method": "GET",
"optional_params": [],
"rel": "Get environment variable",
"required_params": []
},
"UPDATE": {
"href": "https://openshift.redhat.com/broker/rest/domain/ffranz/application/commaf...",
"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/commaf...",
"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/commaf...",
"method": "GET",
"optional_params": [],
"rel": "Get environment variable",
"required_params": []
},
"UPDATE": {
"href": "https://openshift.redhat.com/broker/rest/domain/ffranz/application/commaf...",
"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/commaf...",
"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
12 years, 6 months
[JBoss JIRA] (JBIDE-15766) openshift-java-client: dont refresh env variables on each addition/removal
by Andre Dietisheim (JIRA)
[ https://issues.jboss.org/browse/JBIDE-15766?page=com.atlassian.jira.plugi... ]
Andre Dietisheim edited comment on JBIDE-15766 at 10/24/13 7:00 PM:
--------------------------------------------------------------------
talking to clayton I was told that we should be able to get the map of variables, modify it and push it back. Telling him about our integration tests, that fails if we add the same variable twice (to run it, comment the guard in ApplicationResource#addEnvironmentVariable that prevents you from adding the same key twice):
{code:title=ApplicationResourceIntegrationTest}
@Test
public void shouldNotAddExistingEnvironmentVariableToApplication() throws Throwable {
// precondition
IApplication application = ApplicationTestUtils.getOrCreateApplication(domain);
ApplicationTestUtils.destroyAllEnvironmentVariables(application);
application.addEnvironmentVariable("A_NAME", "A_VALUE");
// operation
try {
application.addEnvironmentVariable("A_NAME", "A_NEW_VALUE");
fail("Should not be able to add same variable a 2nd time");
} catch(OpenShiftException e) {
// success
}
}
{code}
{code}
{
"api_version":1.2,
"data":null,
"messages":[
{
"exit_code":192,
"field":null,
"index":null,
"severity":"error",
"text":"Environment name 'A_NAME' already exists in application"
}
],
"status":"unprocessable_entity",
"supported_api_versions":[
1,
1.1,
1.2,
1.3,
1.4,
1.5,
1.6
],
"type":null,
"version":"1.2"
}
{code}
his quick catch was that we should try to use PUT instead of POST - the link's using POST:
{code}
{
"api_version":1.2,
"data":[
{
...
"SET_UNSET_ENVIRONMENT_VARIABLES":{
"href":"https://openshift.redhat.com/broker/rest/domains/foobarz/applications/sca...",
"method":"POST",
"optional_params":[
{
...
"type":"applications",
"version":"1.2"
}
{code}
...we should override it)
was (Author: adietish):
talking to clayton I was told that we should be able to get the map of variables, modify it and push it back. Telling him about our integration tests, that fails if we add the same variable twice his quick catch was that we should try to use PUT instead of POST - the link's using POST:
{code}
{
"api_version":1.2,
"data":[
{
...
"SET_UNSET_ENVIRONMENT_VARIABLES":{
"href":"https://openshift.redhat.com/broker/rest/domains/foobarz/applications/sca...",
"method":"POST",
"optional_params":[
{
...
"type":"applications",
"version":"1.2"
}
{code}
...we should override it)
> 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
12 years, 6 months
[JBoss JIRA] (JBIDE-15766) openshift-java-client: dont refresh env variables on each addition/removal
by Andre Dietisheim (JIRA)
[ https://issues.jboss.org/browse/JBIDE-15766?page=com.atlassian.jira.plugi... ]
Andre Dietisheim edited comment on JBIDE-15766 at 10/24/13 6:56 PM:
--------------------------------------------------------------------
talking to clayton I was told that we should be able to get the map of variables, modify it and push it back. Telling him about our integration tests, that fails if we add the same variable twice his quick catch was that we should try to use PUT instead of POST - the link's using POST:
{code}
{
"api_version":1.2,
"data":[
{
...
"SET_UNSET_ENVIRONMENT_VARIABLES":{
"href":"https://openshift.redhat.com/broker/rest/domains/foobarz/applications/sca...",
"method":"POST",
"optional_params":[
{
...
"type":"applications",
"version":"1.2"
}
{code}
...we should override it)
was (Author: adietish):
talking to clayton I was told that we should be able to get the map of variables, modify it and push it back. Telling him about our integration tests, that fails if we add the same variable twice his quick catch was that we should try to use PUT instead of POST (the link's using POST, we should override it)
> 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
12 years, 6 months
[JBoss JIRA] (JBIDE-15765) JPP 6.1 recognized as AS 7.2
by Max Rydahl Andersen (JIRA)
[ https://issues.jboss.org/browse/JBIDE-15765?page=com.atlassian.jira.plugi... ]
Max Rydahl Andersen commented on JBIDE-15765:
---------------------------------------------
[~ppalaga] what happened between JPP 6.1 Beta and 6.1 causing it to fall back to this incorrect structure ?
> JPP 6.1 recognized as AS 7.2
> ----------------------------
>
> Key: JBIDE-15765
> URL: https://issues.jboss.org/browse/JBIDE-15765
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: runtime-detection
> Affects Versions: 4.1.1.Beta1
> Reporter: Radoslav Rábara
> Assignee: Rob Stryker
> Priority: Critical
> Labels: respin-a
> Fix For: 4.1.1.Beta1
>
> Attachments: jpp 6.1 recognized as AS 72.jpg
>
>
> JBoss Portal 6.1.0 Final is recognized as AS 7.2 in JBoss Runtime Detection (Type: AS, Version: 7.2). However, JPP 6.1.0 Beta is recognized correctly as JPP 6.1.
--
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
12 years, 6 months
[JBoss JIRA] (JBIDE-15765) JPP 6.1 recognized as AS 7.2
by Snjezana Peco (JIRA)
[ https://issues.jboss.org/browse/JBIDE-15765?page=com.atlassian.jira.plugi... ]
Snjezana Peco reassigned JBIDE-15765:
-------------------------------------
Assignee: Rob Stryker (was: Snjezana Peco)
> JPP 6.1 recognized as AS 7.2
> ----------------------------
>
> Key: JBIDE-15765
> URL: https://issues.jboss.org/browse/JBIDE-15765
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: runtime-detection
> Affects Versions: 4.1.1.Beta1
> Reporter: Radoslav Rábara
> Assignee: Rob Stryker
> Priority: Critical
> Labels: respin-a
> Fix For: 4.1.1.Beta1
>
> Attachments: jpp 6.1 recognized as AS 72.jpg
>
>
> JBoss Portal 6.1.0 Final is recognized as AS 7.2 in JBoss Runtime Detection (Type: AS, Version: 7.2). However, JPP 6.1.0 Beta is recognized correctly as JPP 6.1.
--
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
12 years, 6 months
[JBoss JIRA] (JBIDE-15766) openshift-java-client: dont refresh env variables on each addition/removal
by Andre Dietisheim (JIRA)
[ https://issues.jboss.org/browse/JBIDE-15766?page=com.atlassian.jira.plugi... ]
Andre Dietisheim commented on JBIDE-15766:
------------------------------------------
talking to clayton I was told that we should be able to get the map of variables, modify it and push it back. Telling him about our integration tests, that fails if we add the same variable twice his quick catch was that we should try to use PUT instead of POST (the link's using POST, we should override it)
> 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
12 years, 6 months
[JBoss JIRA] (JBIDE-15765) JPP 6.1 recognized as AS 7.2
by Snjezana Peco (JIRA)
[ https://issues.jboss.org/browse/JBIDE-15765?page=com.atlassian.jira.plugi... ]
Snjezana Peco commented on JBIDE-15765:
---------------------------------------
JPP 6.1 contains <JPP_HOME>/modules/system/layers/base/org/jboss/as/product/eap/dir instead of <JPP_HOME>/modules/system/layers/base/org/jboss/as/product/jpp/dir.
> JPP 6.1 recognized as AS 7.2
> ----------------------------
>
> Key: JBIDE-15765
> URL: https://issues.jboss.org/browse/JBIDE-15765
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: runtime-detection
> Affects Versions: 4.1.1.Beta1
> Reporter: Radoslav Rábara
> Assignee: Snjezana Peco
> Priority: Critical
> Labels: respin-a
> Fix For: 4.1.1.Beta1
>
> Attachments: jpp 6.1 recognized as AS 72.jpg
>
>
> JBoss Portal 6.1.0 Final is recognized as AS 7.2 in JBoss Runtime Detection (Type: AS, Version: 7.2). However, JPP 6.1.0 Beta is recognized correctly as JPP 6.1.
--
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
12 years, 6 months