diff options
author | Ganesh Chandrasekaran <ganesh.c@samsung.com> | 2018-07-20 17:53:04 +0900 |
---|---|---|
committer | Ganesh Chandrasekaran <ganesh.c@samsung.com> | 2018-07-20 18:27:39 +0900 |
commit | e70da25135855b88571b19c108089b74181996a6 (patch) | |
tree | 6f2321abe60457cf5092676d9bee5e624ba3ff22 | |
parent | 77ee1a55c18e1992bcf2b17b09bc874ab8bc8f6a (diff) |
Saltstack port not mandatory
Issue-ID: CCSDK-390
Change-Id: Ie9448d3a3fbbc7e52e8103ca5da1e2a3e080d58c
Signed-off-by: Ganesh Chandrasekaran <ganesh.c@samsung.com>
13 files changed, 75 insertions, 102 deletions
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/impl/SaltstackAdapterImpl.java b/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/impl/SaltstackAdapterImpl.java index 5373c227..5e0cc77e 100644 --- a/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/impl/SaltstackAdapterImpl.java +++ b/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/impl/SaltstackAdapterImpl.java @@ -176,7 +176,7 @@ public class SaltstackAdapterImpl implements SaltstackAdapter { logger.info("Creating ssh client connection"); // set path to keystore file String sshHost = props.getProperty(SS_SERVER_HOSTNAME); - String sshPort = props.getProperty(SS_SERVER_PORT); + String sshPort = reqServerPort(props) ; String sshUserName = props.getProperty(SS_SERVER_USERNAME); String sshPassword = props.getProperty(SS_SERVER_PASSWD); sshClient = new ConnectionBuilder(sshHost, sshPort, sshUserName, sshPassword); @@ -184,7 +184,7 @@ public class SaltstackAdapterImpl implements SaltstackAdapter { // set path to keystore file String sshKey = props.getProperty(SS_SERVER_SSH_KEY); String sshHost = props.getProperty(SS_SERVER_HOSTNAME); - String sshPort = props.getProperty(SS_SERVER_PORT); + String sshPort = reqServerPort(props); logger.info("Creating ssh client with ssh KEY from " + sshKey); sshClient = new ConnectionBuilder(sshHost, sshPort, sshKey); } else if ("BOTH".equalsIgnoreCase(clientType)) { @@ -193,7 +193,7 @@ public class SaltstackAdapterImpl implements SaltstackAdapter { String sshHost = props.getProperty(SS_SERVER_HOSTNAME); String sshUserName = props.getProperty(SS_SERVER_USERNAME); String sshPassword = props.getProperty(SS_SERVER_PASSWD); - String sshPort = props.getProperty(SS_SERVER_PORT); + String sshPort = reqServerPort(props); logger.info("Creating ssh client with ssh KEY from " + sshKey); sshClient = new ConnectionBuilder(sshHost, sshPort, sshUserName, sshPassword, sshKey); } else { @@ -204,13 +204,19 @@ public class SaltstackAdapterImpl implements SaltstackAdapter { logger.error("Error Initializing Saltstack Adapter due to Unknown Exception", e); throw new SvcLogicException("Saltstack Adapter Property file parsing Error = port in property file has to be an integer."); } catch (Exception e) { - logger.error("Error Initializing Saltstack Adapter due to Unknown Exception", e); + logger.error("Error Initializing Saltstack Adapter due to Exception", e); throw new SvcLogicException("Saltstack Adapter Property file parsing Error = " + e.getMessage()); } - logger.info("Initialized Saltstack Adapter"); } + private String reqServerPort(Properties props) { + // use default port if null + if (props.getProperty(SS_SERVER_PORT) == null) + return "22"; + return props.getProperty(SS_SERVER_PORT); + } + private void setSSHClient(Map<String, String> params) throws SvcLogicException { if (sshClient == null) { logger.info("saltstack-adapter.properties not defined so reading saltstack host and " + diff --git a/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/JsonParser.java b/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/JsonParser.java index 0eb1fc0e..3eb353a1 100644 --- a/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/JsonParser.java +++ b/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/JsonParser.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * openECOMP : SDN-C + * ONAP : CCSDK * ================================================================================ * Copyright (C) 2018 Samsung Electronics. All rights * reserved. diff --git a/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/SaltstackMessageParser.java b/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/SaltstackMessageParser.java index 3095fca9..8548efc0 100644 --- a/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/SaltstackMessageParser.java +++ b/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/SaltstackMessageParser.java @@ -78,13 +78,9 @@ public class SaltstackMessageParser { * the appropriate PORT number. */ public String reqPortResult(Map<String, String> params) throws SvcLogicException { - - final String[] mandatoryTestParams = {SS_AGENT_HOSTNAME_KEY, SS_AGENT_PORT_KEY, USER_KEY, - PASS_KEY}; - - for (String key : mandatoryTestParams) { - throwIfMissingMandatoryParam(params, key); - } + // use default port if null + if (params.get(SS_AGENT_PORT_KEY) == null) + return "22"; return params.get(SS_AGENT_PORT_KEY); } @@ -95,12 +91,7 @@ public class SaltstackMessageParser { */ public String reqHostNameResult(Map<String, String> params) throws SvcLogicException { - final String[] mandatoryTestParams = {SS_AGENT_HOSTNAME_KEY, SS_AGENT_PORT_KEY, USER_KEY, - PASS_KEY}; - - for (String key : mandatoryTestParams) { - throwIfMissingMandatoryParam(params, key); - } + throwIfMissingMandatoryParam(params, SS_AGENT_HOSTNAME_KEY); return params.get(SS_AGENT_HOSTNAME_KEY); } @@ -126,12 +117,7 @@ public class SaltstackMessageParser { */ public String reqCmd(Map<String, String> params) throws SvcLogicException { - final String[] mandatoryTestParams = {CMD_EXEC, IS_SLS_EXEC}; - - for (String key : mandatoryTestParams) { - throwIfMissingMandatoryParam(params, key); - } - + throwIfMissingMandatoryParam(params, CMD_EXEC); return params.get(SaltstackMessageParser.CMD_EXEC); } @@ -142,12 +128,7 @@ public class SaltstackMessageParser { */ public String reqSlsFile(Map<String, String> params) throws SvcLogicException { - final String[] mandatoryTestParams = {SLS_FILE_LOCATION}; - - for (String key : mandatoryTestParams) { - throwIfMissingMandatoryParam(params, key); - } - + throwIfMissingMandatoryParam(params, SLS_FILE_LOCATION); return params.get(SaltstackMessageParser.SLS_FILE_LOCATION); } @@ -158,11 +139,7 @@ public class SaltstackMessageParser { */ public String reqSlsName(Map<String, String> params) throws SvcLogicException { - final String[] mandatoryTestParams = {SLS_NAME}; - - for (String key : mandatoryTestParams) { - throwIfMissingMandatoryParam(params, key); - } + throwIfMissingMandatoryParam(params, SLS_NAME); String slsName = params.get(SaltstackMessageParser.SLS_NAME); try { if (slsName.substring(slsName.lastIndexOf("."), slsName.length()).equalsIgnoreCase(".sls")) { @@ -309,12 +286,7 @@ public class SaltstackMessageParser { */ public String reqUserNameResult(Map<String, String> params) throws SvcLogicException { - final String[] mandatoryTestParams = {SS_AGENT_HOSTNAME_KEY, SS_AGENT_PORT_KEY, USER_KEY, - PASS_KEY}; - - for (String key : mandatoryTestParams) { - throwIfMissingMandatoryParam(params, key); - } + throwIfMissingMandatoryParam(params, USER_KEY); return params.get(USER_KEY); } @@ -325,12 +297,7 @@ public class SaltstackMessageParser { */ public String reqPasswordResult(Map<String, String> params) throws SvcLogicException { - final String[] mandatoryTestParams = {SS_AGENT_HOSTNAME_KEY, SS_AGENT_PORT_KEY, USER_KEY, - PASS_KEY}; - - for (String key : mandatoryTestParams) { - throwIfMissingMandatoryParam(params, key); - } + throwIfMissingMandatoryParam(params, PASS_KEY); return params.get(PASS_KEY); } diff --git a/saltstack-adapter/saltstack-adapter-provider/src/main/resources/org/opendaylight/blueprint/saltstack-adapter-blueprint.xml b/saltstack-adapter/saltstack-adapter-provider/src/main/resources/org/opendaylight/blueprint/saltstack-adapter-blueprint.xml index 2c3b7b04..446ab3e4 100755 --- a/saltstack-adapter/saltstack-adapter-provider/src/main/resources/org/opendaylight/blueprint/saltstack-adapter-blueprint.xml +++ b/saltstack-adapter/saltstack-adapter-provider/src/main/resources/org/opendaylight/blueprint/saltstack-adapter-blueprint.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- ============LICENSE_START======================================================= - openECOMP : SDN-C + ONAP : CCSDK ================================================================================ Copyright (C) 2017 - 2018 Samsung Electronics. All rights reserved. diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java index deb46534..29d08801 100644 --- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java +++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java @@ -53,7 +53,7 @@ public class TestSaltstackAdapterPropertiesProviderImpl { params = null; } - @Test(expected = SvcLogicException.class) + @Test public void reqExecCommand_setPropertiesBasicPortNull() throws SvcLogicException, IllegalStateException, IllegalArgumentException { params.put("org.onap.appc.adapter.saltstack.clientType", "BASIC"); @@ -104,7 +104,7 @@ public class TestSaltstackAdapterPropertiesProviderImpl { adapter = new SaltstackAdapterImpl(propProvider); } - @Test(expected = SvcLogicException.class) + @Test public void reqExecCommand_setPropertiesSSH_CERTPortNull() throws SvcLogicException, IllegalStateException, IllegalArgumentException { params.put("org.onap.appc.adapter.saltstack.clientType", "SSH_CERT"); @@ -155,7 +155,7 @@ public class TestSaltstackAdapterPropertiesProviderImpl { adapter = new SaltstackAdapterImpl(propProvider); } - @Test(expected = SvcLogicException.class) + @Test public void reqExecCommand_setPropertiesBOTHPortNull() throws SvcLogicException, IllegalStateException, IllegalArgumentException { params.put("org.onap.appc.adapter.saltstack.clientType", "BOTH"); diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java index ed1e02c4..d082285f 100644 --- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java +++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * openECOMP : SDN-C + * ONAP : CCSDK * ================================================================================ * Copyright (C) 2018 Samsung Electronics. All rights * reserved. diff --git a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exe-nonSLS.xml b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exe-nonSLS.xml index e28bbc2a..6fbbe5b1 100644 --- a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exe-nonSLS.xml +++ b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exe-nonSLS.xml @@ -3,7 +3,7 @@ xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd'
module='APPC' version='2.0.1'>
<method rpc='saltstack-adapter-1.0-exe-nonSLS' mode='sync'>
- <execute plugin='org.openecomp.appc.adapter.ansible.SaltstackAdapter'
+ <execute plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter'
method='reqExecCommand'>
<parameter name='HostName' value='`$AgentUrl`'/>
<parameter name='Port' value='`$Port`'/>
@@ -17,9 +17,9 @@ <return status='failure'>
<parameter name='error-code' value='200'/>
<parameter name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
<outcome value='Other'>
@@ -28,19 +28,19 @@ <return status='failure'>
<parameter name='error-code' value='200'/>
<parameter name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
<outcome value='200'>
<return status='success'>
<parameter name='output.status.code'
- value='`$org.openecomp.appc.adapter.ansible.result.code`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.result.code`'/>
<parameter name='output.status.message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
</switch>
diff --git a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-SLSFile.json b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-SLSFile.json index deefddf3..7f427674 100644 --- a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-SLSFile.json +++ b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-SLSFile.json @@ -37,7 +37,7 @@ "id": "31587001.4259e", "type": "returnFailure", "name": "return failure", - "xml": "<return status='failure'>\n<parameter name='error-code' value='200' />\n<parameter name='error-message' value='`$org.openecomp.appc.adapter.ansible.message`' />\n<parameter name='output.status.results' value='`$org.openecomp.appc.adapter.ansible.results`' />\n", + "xml": "<return status='failure'>\n<parameter name='error-code' value='200' />\n<parameter name='error-message' value='`$org.openecomp.appc.adapter.saltstack.message`' />\n<parameter name='output.status.results' value='`$org.openecomp.appc.adapter.saltstack.results`' />\n", "comments": "", "x": 1262, "y": 365, @@ -48,7 +48,7 @@ "id": "65cc87e2.a95188", "type": "execute", "name": "execute", - "xml": "<execute plugin='org.openecomp.appc.adapter.ansible.SaltstackAdapter' method='reqExecCommand' >\n <parameter name='HostName' value='`$AgentUrl`'/>\n <parameter name='Port' value='`$Port`'/>\n <parameter name='User' value='`$User`'/>\n <parameter name='Password' value='`$Password`'/>\n <parameter name='Id' value='test1'/>\n <parameter name='Cmd' value='salt '*' test.ping --out=json --static'/>\n <parameter name='SlsExec' value='false'/>\n <parameter name='Timeout' value='`$Timeout`'/>\n", + "xml": "<execute plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter' method='reqExecCommand' >\n <parameter name='HostName' value='`$AgentUrl`'/>\n <parameter name='Port' value='`$Port`'/>\n <parameter name='User' value='`$User`'/>\n <parameter name='Password' value='`$Password`'/>\n <parameter name='Id' value='test1'/>\n <parameter name='Cmd' value='salt '*' test.ping --out=json --static'/>\n <parameter name='SlsExec' value='false'/>\n <parameter name='Timeout' value='`$Timeout`'/>\n", "comments": "", "outputs": 1, "x": 761, @@ -146,7 +146,7 @@ "id": "2856792.c401a86", "type": "returnSuccess", "name": "return success", - "xml": "<return status='success'>\n<parameter name='output.status.code' value='`$org.openecomp.appc.adapter.ansible.result.code`' />\n<parameter name='output.status.message' value='`$org.openecomp.appc.adapter.ansible.message`'/>\n<parameter name='output.status.results' value = '`$org.openecomp.appc.adapter.ansible.results`'/>\n", + "xml": "<return status='success'>\n<parameter name='output.status.code' value='`$org.openecomp.appc.adapter.saltstack.result.code`' />\n<parameter name='output.status.message' value='`$org.openecomp.appc.adapter.saltstack.message`'/>\n<parameter name='output.status.results' value = '`$org.openecomp.appc.adapter.saltstack.results`'/>\n", "comments": "", "x": 1042, "y": 656, @@ -209,7 +209,7 @@ "id": "770411a5.18825", "type": "execute", "name": "execute", - "xml": "<execute plugin='org.openecomp.appc.adapter.ansible.SaltstackAdapter' method='reqExecCommand' >\n <parameter name='HostName' value='`$AgentUrl`'/>\n <parameter name='Port' value='`$Port`'/>\n <parameter name='User' value='`$User`'/>\n <parameter name='Password' value='`$Password`'/>\n <parameter name='Id' value='test2'/>\n <parameter name='Cmd' value='cd /srv/salt/; salt 'minion1' state.apply vim --out=json --static'/>\n <parameter name='SlsExec' value='true'/>\n <parameter name='Timeout' value='`$Timeout`'/>\n", + "xml": "<execute plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter' method='reqExecCommand' >\n <parameter name='HostName' value='`$AgentUrl`'/>\n <parameter name='Port' value='`$Port`'/>\n <parameter name='User' value='`$User`'/>\n <parameter name='Password' value='`$Password`'/>\n <parameter name='Id' value='test2'/>\n <parameter name='Cmd' value='cd /srv/salt/; salt 'minion1' state.apply vim --out=json --static'/>\n <parameter name='SlsExec' value='true'/>\n <parameter name='Timeout' value='`$Timeout`'/>\n", "comments": "", "outputs": 1, "x": 773, diff --git a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-SLSFile.xml b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-SLSFile.xml index 9861351d..fc63bbd7 100644 --- a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-SLSFile.xml +++ b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-SLSFile.xml @@ -3,7 +3,7 @@ xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd'
module='APPC' version='2.0.1'>
<method rpc='saltstack-adapter-1.0-exec-SLSFile' mode='sync'>
- <execute plugin='org.openecomp.appc.adapter.ansible.SaltstackAdapter'
+ <execute plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter'
method='reqExecCommand'>
<parameter name='HostName' value='`$AgentUrl`'/>
<parameter name='Port' value='`$Port`'/>
@@ -18,9 +18,9 @@ <return status='failure'>
<parameter name='error-code' value='200'/>
<parameter name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
<outcome value='Other'>
@@ -29,9 +29,9 @@ <return status='failure'>
<parameter name='error-code' value='200'/>
<parameter name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
<outcome value='200'>
@@ -40,14 +40,14 @@ <return status='failure'>
<parameter name='error-code' value='200'/>
<parameter name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
<outcome value='true'>
<execute
- plugin='org.openecomp.appc.adapter.ansible.SaltstackAdapter'
+ plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter'
method='reqExecCommand'>
<parameter name='HostName'
value='`$AgentUrl`'/>
@@ -66,10 +66,10 @@ <parameter name='error-code'
value='200'/>
<parameter name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter
name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
<outcome value='Other'>
@@ -78,13 +78,13 @@ <return status='success'>
<parameter
name='output.status.code'
- value='`$org.openecomp.appc.adapter.ansible.result.code`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.result.code`'/>
<parameter
name='output.status.message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter
name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
<outcome value='Other'>
@@ -93,10 +93,10 @@ value='200'/>
<parameter
name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter
name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
</switch>
diff --git a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-multi-sls.json b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-multi-sls.json index 1b891a20..d7cfef01 100644 --- a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-multi-sls.json +++ b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-multi-sls.json @@ -37,7 +37,7 @@ "id": "40ce8a6.5f7d174", "type": "returnFailure", "name": "return failure", - "xml": "<return status='failure'>\n<parameter name='error-code' value='200' />\n<parameter name='error-message' value='`$org.openecomp.appc.adapter.ansible.message`' />\n<parameter name='output.status.results' value='`$org.openecomp.appc.adapter.ansible.results`' />\n", + "xml": "<return status='failure'>\n<parameter name='error-code' value='200' />\n<parameter name='error-message' value='`$org.openecomp.appc.adapter.saltstack.message`' />\n<parameter name='output.status.results' value='`$org.openecomp.appc.adapter.saltstack.results`' />\n", "comments": "", "x": 1325, "y": 455, @@ -48,7 +48,7 @@ "id": "c332cb01.51a3e8", "type": "execute", "name": "execute", - "xml": "<execute plugin='org.openecomp.appc.adapter.ansible.SaltstackAdapter' method='reqExecCommand' >\n <parameter name='HostName' value='`$AgentUrl`'/>\n <parameter name='Port' value='`$Port`'/>\n <parameter name='User' value='`$User`'/>\n <parameter name='Password' value='`$Password`'/>\n <parameter name='Id' value='test1'/>\n <parameter name='Cmd' value='salt '*' test.ping --out=json --static'/>\n <parameter name='SlsExec' value='false'/>\n <parameter name='Timeout' value='`$Timeout`'/>\n", + "xml": "<execute plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter' method='reqExecCommand' >\n <parameter name='HostName' value='`$AgentUrl`'/>\n <parameter name='Port' value='`$Port`'/>\n <parameter name='User' value='`$User`'/>\n <parameter name='Password' value='`$Password`'/>\n <parameter name='Id' value='test1'/>\n <parameter name='Cmd' value='salt '*' test.ping --out=json --static'/>\n <parameter name='SlsExec' value='false'/>\n <parameter name='Timeout' value='`$Timeout`'/>\n", "comments": "", "outputs": 1, "x": 824, @@ -146,7 +146,7 @@ "id": "e45accfe.91615", "type": "returnSuccess", "name": "return success", - "xml": "<return status='success'>\n<parameter name='output.status.code' value='`$org.openecomp.appc.adapter.ansible.result.code`' />\n<parameter name='output.status.message' value='`$org.openecomp.appc.adapter.ansible.message`'/>\n<parameter name='output.status.results' value = '`$org.openecomp.appc.adapter.ansible.results`'/>\n", + "xml": "<return status='success'>\n<parameter name='output.status.code' value='`$org.openecomp.appc.adapter.saltstack.result.code`' />\n<parameter name='output.status.message' value='`$org.openecomp.appc.adapter.saltstack.message`'/>\n<parameter name='output.status.results' value = '`$org.openecomp.appc.adapter.saltstack.results`'/>\n", "comments": "", "x": 1345, "y": 757, @@ -209,7 +209,7 @@ "id": "df0c0907.d17838", "type": "execute", "name": "execute", - "xml": "<execute plugin='org.openecomp.appc.adapter.ansible.SaltstackAdapter' method='reqExecCommand' >\n <parameter name='HostName' value='`$AgentUrl`'/>\n <parameter name='Port' value='`$Port`'/>\n <parameter name='User' value='`$User`'/>\n <parameter name='Password' value='`$Password`'/>\n <parameter name='Id' value='test2'/>\n <parameter name='Cmd' value='salt 'minion1' pkg.install vim --out=json --static'/>\n <parameter name='SlsExec' value='false'/>\n <parameter name='Timeout' value='`$Timeout`'/>\n", + "xml": "<execute plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter' method='reqExecCommand' >\n <parameter name='HostName' value='`$AgentUrl`'/>\n <parameter name='Port' value='`$Port`'/>\n <parameter name='User' value='`$User`'/>\n <parameter name='Password' value='`$Password`'/>\n <parameter name='Id' value='test2'/>\n <parameter name='Cmd' value='salt 'minion1' pkg.install vim --out=json --static'/>\n <parameter name='SlsExec' value='false'/>\n <parameter name='Timeout' value='`$Timeout`'/>\n", "comments": "", "outputs": 1, "x": 836, diff --git a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-multi-sls.xml b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-multi-sls.xml index 404ac7ac..cc36b1ca 100644 --- a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-multi-sls.xml +++ b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-multi-sls.xml @@ -80,13 +80,13 @@ <return status='success'>
<parameter
name='output.status.code'
- value='`$org.openecomp.appc.adapter.ansible.result.code`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.result.code`'/>
<parameter
name='output.status.message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter
name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
<outcome value='Other'>
@@ -96,10 +96,10 @@ value='200'/>
<parameter
name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter
name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
</switch>
@@ -110,10 +110,10 @@ value='200'/>
<parameter
name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter
name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
</switch>
diff --git a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-single-SLSComm.json b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-single-SLSComm.json index 920e1145..4be0db3d 100644 --- a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-single-SLSComm.json +++ b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-single-SLSComm.json @@ -37,7 +37,7 @@ "id": "55a7736.2789e8c", "type": "returnFailure", "name": "return failure", - "xml": "<return status='failure'>\n<parameter name='error-code' value='200' />\n<parameter name='error-message' value='`$org.openecomp.appc.adapter.ansible.message`' />\n<parameter name='output.status.results' value='`$org.openecomp.appc.adapter.ansible.results`' />\n", + "xml": "<return status='failure'>\n<parameter name='error-code' value='200' />\n<parameter name='error-message' value='`$org.openecomp.appc.adapter.saltstack.message`' />\n<parameter name='output.status.results' value='`$org.openecomp.appc.adapter.saltstack.results`' />\n", "comments": "", "x": 1064, "y": 453, @@ -48,7 +48,7 @@ "id": "f4e59dd0.ee45f", "type": "execute", "name": "execute", - "xml": "<execute plugin='org.openecomp.appc.adapter.ansible.SaltstackAdapter' method='reqExecCommand' >\n <parameter name='HostName' value='`$AgentUrl`'/>\n <parameter name='Port' value='`$Port`'/>\n <parameter name='User' value='`$User`'/>\n <parameter name='Password' value='`$Password`'/>\n <parameter name='Id' value='test1'/>\n <parameter name='Cmd' value='salt '*' test.ping --out=json --static'/>\n <parameter name='SlsExec' value='false'/>\n <parameter name='Timeout' value='`$Timeout`'/>\n", + "xml": "<execute plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter' method='reqExecCommand' >\n <parameter name='HostName' value='`$AgentUrl`'/>\n <parameter name='Port' value='`$Port`'/>\n <parameter name='User' value='`$User`'/>\n <parameter name='Password' value='`$Password`'/>\n <parameter name='Id' value='test1'/>\n <parameter name='Cmd' value='salt '*' test.ping --out=json --static'/>\n <parameter name='SlsExec' value='false'/>\n <parameter name='Timeout' value='`$Timeout`'/>\n", "comments": "", "outputs": 1, "x": 735, @@ -146,7 +146,7 @@ "id": "ce510062.8dcc7", "type": "returnSuccess", "name": "return success", - "xml": "<return status='success'>\n<parameter name='output.status.code' value='`$org.openecomp.appc.adapter.ansible.result.code`' />\n<parameter name='output.status.message' value='`$org.openecomp.appc.adapter.ansible.message`'/>\n<parameter name='output.status.results' value = '`$org.openecomp.appc.adapter.ansible.results`'/>\n", + "xml": "<return status='success'>\n<parameter name='output.status.code' value='`$org.openecomp.appc.adapter.saltstack.result.code`' />\n<parameter name='output.status.message' value='`$org.openecomp.appc.adapter.saltstack.message`'/>\n<parameter name='output.status.results' value = '`$org.openecomp.appc.adapter.saltstack.results`'/>\n", "comments": "", "x": 893, "y": 399, diff --git a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-single-SLSComm.xml b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-single-SLSComm.xml index dfc4691d..bd9aea77 100644 --- a/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-single-SLSComm.xml +++ b/saltstack-adapter/saltstack-directed-graphs-sample/reqExecCommand/APPC_saltstack-adapter-1.0-exec-single-SLSComm.xml @@ -3,7 +3,7 @@ xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd'
module='APPC' version='2.0.1'>
<method rpc='saltstack-adapter-1.0-exec-single-SLSComm' mode='sync'>
- <execute plugin='org.openecomp.appc.adapter.ansible.SaltstackAdapter'
+ <execute plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter'
method='reqExecCommand'>
<parameter name='HostName' value='`$AgentUrl`'/>
<parameter name='Port' value='`$Port`'/>
@@ -18,9 +18,9 @@ <return status='failure'>
<parameter name='error-code' value='200'/>
<parameter name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
<outcome value='Other'>
@@ -28,20 +28,20 @@ <outcome value='200'>
<return status='success'>
<parameter name='output.status.code'
- value='`$org.openecomp.appc.adapter.ansible.result.code`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.result.code`'/>
<parameter name='output.status.message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
<outcome value='Other'>
<return status='failure'>
<parameter name='error-code' value='200'/>
<parameter name='error-message'
- value='`$org.openecomp.appc.adapter.ansible.message`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.message`'/>
<parameter name='output.status.results'
- value='`$org.openecomp.appc.adapter.ansible.results`'/>
+ value='`$org.openecomp.appc.adapter.saltstack.results`'/>
</return>
</outcome>
</switch>
|