diff --git a/hqu/hqapi1/app/ServerconfigController.groovy b/hqu/hqapi1/app/ServerconfigController.groovy index 046f8c59..e7d4d978 100644 --- a/hqu/hqapi1/app/ServerconfigController.groovy +++ b/hqu/hqapi1/app/ServerconfigController.groovy @@ -10,7 +10,7 @@ class ServerconfigController extends ApiController { def props = _serverMan.config renderXml() { - ServerConfigsResponse() { + ServerConfigResponse() { if (!user.isSuperUser()) { out << getFailureXML(ErrorCode.PERMISSION_DENIED, "User " + user.name + " is not superuser") diff --git a/src/org/hyperic/hq/hqapi1/ServerConfigApi.java b/src/org/hyperic/hq/hqapi1/ServerConfigApi.java index d535c653..dc3ac741 100644 --- a/src/org/hyperic/hq/hqapi1/ServerConfigApi.java +++ b/src/org/hyperic/hq/hqapi1/ServerConfigApi.java @@ -1,6 +1,6 @@ package org.hyperic.hq.hqapi1; -import org.hyperic.hq.hqapi1.types.ServerConfigsResponse; +import org.hyperic.hq.hqapi1.types.ServerConfigResponse; import org.hyperic.hq.hqapi1.types.ServerConfig; import org.hyperic.hq.hqapi1.types.ServerConfigRequest; import org.hyperic.hq.hqapi1.types.StatusResponse; @@ -26,9 +26,9 @@ public class ServerConfigApi extends BaseApi { * * @throws IOException If a network error occurs while making the request. */ - public ServerConfigsResponse getConfig() throws IOException { + public ServerConfigResponse getConfig() throws IOException { return doGet("serverconfig/getConfig.hqu", new HashMap(), - ServerConfigsResponse.class); + ServerConfigResponse.class); } /** diff --git a/src/org/hyperic/hq/hqapi1/test/ServerConfigGet_test.java b/src/org/hyperic/hq/hqapi1/test/ServerConfigGet_test.java index 8d333c9c..581cc215 100644 --- a/src/org/hyperic/hq/hqapi1/test/ServerConfigGet_test.java +++ b/src/org/hyperic/hq/hqapi1/test/ServerConfigGet_test.java @@ -3,7 +3,7 @@ import org.hyperic.hq.hqapi1.ServerConfigApi; import org.hyperic.hq.hqapi1.HQApi; import org.hyperic.hq.hqapi1.UserApi; -import org.hyperic.hq.hqapi1.types.ServerConfigsResponse; +import org.hyperic.hq.hqapi1.types.ServerConfigResponse; import org.hyperic.hq.hqapi1.types.User; import org.hyperic.hq.hqapi1.types.StatusResponse; import org.hyperic.hq.hqapi1.types.UserResponse; @@ -20,7 +20,7 @@ public void testGetConfig() throws Exception { ServerConfigApi sApi = getApi().getServerConfigApi(); - ServerConfigsResponse response = sApi.getConfig(); + ServerConfigResponse response = sApi.getConfig(); hqAssertSuccess(response); assertTrue("No server configuration settings found", response.getServerConfig().size() > 0); @@ -46,7 +46,7 @@ public void testGetConfigInvalidUser() throws Exception { ServerConfigApi sApi = getApi(user.getName(), "test").getServerConfigApi(); - ServerConfigsResponse response = sApi.getConfig(); + ServerConfigResponse response = sApi.getConfig(); hqAssertFailurePermissionDenied(response); // Cleanup diff --git a/src/org/hyperic/hq/hqapi1/test/ServerConfigSet_test.java b/src/org/hyperic/hq/hqapi1/test/ServerConfigSet_test.java index 4bab03e7..fd0c5879 100644 --- a/src/org/hyperic/hq/hqapi1/test/ServerConfigSet_test.java +++ b/src/org/hyperic/hq/hqapi1/test/ServerConfigSet_test.java @@ -2,7 +2,7 @@ import org.hyperic.hq.hqapi1.ServerConfigApi; import org.hyperic.hq.hqapi1.HQApi; -import org.hyperic.hq.hqapi1.types.ServerConfigsResponse; +import org.hyperic.hq.hqapi1.types.ServerConfigResponse; import org.hyperic.hq.hqapi1.types.StatusResponse; import org.hyperic.hq.hqapi1.types.User; import org.hyperic.hq.hqapi1.types.UserResponse; @@ -22,7 +22,7 @@ public void testSetAllConfig() throws Exception { ServerConfigApi sApi = getApi().getServerConfigApi(); - ServerConfigsResponse configResponse = sApi.getConfig(); + ServerConfigResponse configResponse = sApi.getConfig(); hqAssertSuccess(configResponse); StatusResponse response = sApi.setConfig(configResponse.getServerConfig()); @@ -33,7 +33,7 @@ public void testSetSingleConfig() throws Exception { ServerConfigApi sApi = getApi().getServerConfigApi(); - ServerConfigsResponse configResponse = sApi.getConfig(); + ServerConfigResponse configResponse = sApi.getConfig(); hqAssertSuccess(configResponse); List configs = configResponse.getServerConfig(); @@ -91,7 +91,7 @@ public void testSetConfigInvalidUser() throws Exception { api.getUserApi().createUser(user, "test"); // Create test user w/o Admin hqAssertSuccess(userCreateResponse); - ServerConfigsResponse response = api.getServerConfigApi().getConfig(); + ServerConfigResponse response = api.getServerConfigApi().getConfig(); hqAssertSuccess(response); // Re-sync with invalid user diff --git a/src/org/hyperic/hq/hqapi1/test/WADLServerConfig_test.java b/src/org/hyperic/hq/hqapi1/test/WADLServerConfig_test.java index 0f91b5e0..841b920c 100644 --- a/src/org/hyperic/hq/hqapi1/test/WADLServerConfig_test.java +++ b/src/org/hyperic/hq/hqapi1/test/WADLServerConfig_test.java @@ -8,7 +8,7 @@ public void testGet() throws Exception { Endpoint.ServerConfigGetConfigHqu get = new Endpoint.ServerConfigGetConfigHqu(); - ServerConfigsResponse response = get.getAsServerConfigsResponse(); + ServerConfigResponse response = get.getAsServerConfigResponse(); hqAssertSuccess(response); } @@ -18,7 +18,7 @@ public void testSet() throws Exception { Endpoint.ServerConfigSetConfigHqu set = new Endpoint.ServerConfigSetConfigHqu(); - ServerConfigsResponse response = get.getAsServerConfigsResponse(); + ServerConfigResponse response = get.getAsServerConfigResponse(); hqAssertSuccess(response); ServerConfigRequest request = new ServerConfigRequest(); diff --git a/src/org/hyperic/hq/hqapi1/tools/ServerConfigCommand.java b/src/org/hyperic/hq/hqapi1/tools/ServerConfigCommand.java index c5c0fef3..00d5764e 100644 --- a/src/org/hyperic/hq/hqapi1/tools/ServerConfigCommand.java +++ b/src/org/hyperic/hq/hqapi1/tools/ServerConfigCommand.java @@ -10,16 +10,16 @@ import org.hyperic.hq.hqapi1.HQApi; import org.hyperic.hq.hqapi1.XmlUtil; import org.hyperic.hq.hqapi1.ServerConfigApi; -import org.hyperic.hq.hqapi1.types.ServerConfigsResponse; +import org.hyperic.hq.hqapi1.types.ServerConfigResponse; import org.hyperic.hq.hqapi1.types.ServerConfig; import org.hyperic.hq.hqapi1.types.StatusResponse; public class ServerConfigCommand extends Command { - private static String CMD_GET = "getConfig"; - private static String CMD_GET_PARAMETER = "getConfigParameter"; - private static String CMD_SET = "setConfig"; - private static String CMD_SET_PARAMETER = "setConfigParameter"; + private static String CMD_GET = "get"; + private static String CMD_GET_PARAMETER = "getParameter"; + private static String CMD_SET = "set"; + private static String CMD_SET_PARAMETER = "setParameter"; private static String[] COMMANDS = { CMD_GET, CMD_GET_PARAMETER, CMD_SET, CMD_SET_PARAMETER}; @@ -60,7 +60,7 @@ private void get(String[] args) throws Exception { HQApi api = getApi(options); ServerConfigApi configApi = api.getServerConfigApi(); - ServerConfigsResponse response = configApi.getConfig(); + ServerConfigResponse response = configApi.getConfig(); checkSuccess(response); XmlUtil.serialize(response, System.out, Boolean.TRUE); @@ -80,7 +80,7 @@ private void getParameter(String[] args) throws Exception { String key = (String)getRequired(options, OPT_KEY); - ServerConfigsResponse response = configApi.getConfig(); + ServerConfigResponse response = configApi.getConfig(); checkSuccess(response); for (ServerConfig c : response.getServerConfig()) { @@ -102,7 +102,7 @@ private void set(String[] args) throws Exception { ServerConfigApi serverConfigApi = api.getServerConfigApi(); InputStream is = getInputStream(options); - ServerConfigsResponse resp = XmlUtil.deserialize(ServerConfigsResponse.class, is); + ServerConfigResponse resp = XmlUtil.deserialize(ServerConfigResponse.class, is); List config = resp.getServerConfig(); StatusResponse response = serverConfigApi.setConfig(config); @@ -127,7 +127,7 @@ private void setParameter(String[] args) throws Exception { String key = (String)getRequired(options, OPT_KEY); String value = (String)getRequired(options, OPT_VALUE); - ServerConfigsResponse response = configApi.getConfig(); + ServerConfigResponse response = configApi.getConfig(); checkSuccess(response); List config = response.getServerConfig(); diff --git a/xsd/HQApi1.wadl b/xsd/HQApi1.wadl index 0f4267ca..eff53c3a 100644 --- a/xsd/HQApi1.wadl +++ b/xsd/HQApi1.wadl @@ -1124,7 +1124,7 @@ + element="ServerConfigResponse"/> diff --git a/xsd/HQApi1.xsd b/xsd/HQApi1.xsd index eb85aabf..3c0a49ff 100644 --- a/xsd/HQApi1.xsd +++ b/xsd/HQApi1.xsd @@ -874,7 +874,7 @@ - +