- * Method that validates that the Map has enough information
- * to query Ansible server for logs. If so, it populates the appropriate
- * returns the appropriate url, else an empty string.
+ * Method that validates that the Map has enough information to query Ansible
+ * server for a result. If so, it returns the appropriate url, else an empty
+ * string.
+ */
+ public String reqUriResultWithIP(Map<String, String> params, String serverIP) throws APPCException {
+
+ final String[] mandatoryTestParams = { AGENT_URL_KEY, ID_KEY, USER_KEY, PASS_KEY };
+
+ for (String key : mandatoryTestParams) {
+ throwIfMissingMandatoryParam(params, key);
+ }
+ String[] arr1 = params.get(AGENT_URL_KEY).split("//", 2);
+ String[] arr2 = arr1[1].split(":", 2);
+ return arr1[0] + "//" + serverIP + ":" + arr2[1] + "?Id=" + params.get(ID_KEY) + "&Type=GetResult";
+ }
+
+ /**
+ * Method that validates that the Map has enough information to query Ansible
+ * server for logs. If so, it populates the appropriate returns the appropriate
+ * url, else an empty string.