From 7dbb6441c95aa5691a59dc918f864b4bf4e2e2ed Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 18 Jul 2017 20:35:53 -0400 Subject: [CCSDK-6] Populate seed code Add seed code for sli/plugins repository Changed groupId to org.onap.ccsdk.sli.plugins Updated to compile against CCSDK version of SLI Change-Id: Ib392530ea79b8544087692964bd65179896aa595 Signed-off-by: Dan Timoney --- restapi-call-node/provider/pom.xml | 101 +++ .../org/openecomp/sdnc/restapicall/Format.java | 36 + .../org/openecomp/sdnc/restapicall/HttpMethod.java | 42 ++ .../openecomp/sdnc/restapicall/HttpResponse.java | 31 + .../org/openecomp/sdnc/restapicall/JsonParser.java | 85 +++ .../org/openecomp/sdnc/restapicall/Parameters.java | 46 ++ .../sdnc/restapicall/RestapiCallNode.java | 759 +++++++++++++++++++++ .../openecomp/sdnc/restapicall/RetryException.java | 30 + .../openecomp/sdnc/restapicall/RetryPolicy.java | 59 ++ .../sdnc/restapicall/RetryPolicyStore.java | 54 ++ .../openecomp/sdnc/restapicall/XmlJsonUtil.java | 372 ++++++++++ .../org/openecomp/sdnc/restapicall/XmlParser.java | 160 +++++ .../META-INF/spring/restapi-call-node-context.xml | 49 ++ .../spring/restapi-call-node-osgi-context.xml | 32 + .../src/main/resources/default-ueb-message.json | 32 + .../src/main/resources/get-multicast-data.json | 34 + .../main/resources/northbound-api-template.json | 43 ++ .../src/main/resources/northbound-api-template.xml | 43 ++ ...iguration-notification-northbound-template.json | 44 ++ .../update-vpe-data-with-apply-group.json | 53 ++ .../src/main/resources/vnf-information-update.json | 24 + .../src/main/resources/vpn-allocation-request.json | 36 + .../src/main/resources/vpn-information-update.json | 24 + ...service-configuration-information-template.json | 37 + .../resources/vrf-update-vlan-status-template.json | 33 + .../provider/src/main/resources/vrf-update.json | 77 +++ .../openecomp/sdnc/restapicall/TestJsonParser.java | 65 ++ .../sdnc/restapicall/TestRestapiCallNode.java | 92 +++ .../sdnc/restapicall/TestXmlJsonUtil.java | 215 ++++++ .../openecomp/sdnc/restapicall/TestXmlParser.java | 75 ++ .../provider/src/test/resources/test-template.json | 57 ++ .../provider/src/test/resources/test.json | 48 ++ .../provider/src/test/resources/test.xml | 172 +++++ .../provider/src/test/resources/test3.xml | 82 +++ 34 files changed, 3142 insertions(+) create mode 100755 restapi-call-node/provider/pom.xml create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpMethod.java create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpResponse.java create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/JsonParser.java create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Parameters.java create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RestapiCallNode.java create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryException.java create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicy.java create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicyStore.java create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlJsonUtil.java create mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlParser.java create mode 100644 restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml create mode 100644 restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml create mode 100644 restapi-call-node/provider/src/main/resources/default-ueb-message.json create mode 100644 restapi-call-node/provider/src/main/resources/get-multicast-data.json create mode 100644 restapi-call-node/provider/src/main/resources/northbound-api-template.json create mode 100644 restapi-call-node/provider/src/main/resources/northbound-api-template.xml create mode 100644 restapi-call-node/provider/src/main/resources/service-configuration-notification-northbound-template.json create mode 100644 restapi-call-node/provider/src/main/resources/update-vpe-data-with-apply-group.json create mode 100644 restapi-call-node/provider/src/main/resources/vnf-information-update.json create mode 100644 restapi-call-node/provider/src/main/resources/vpn-allocation-request.json create mode 100644 restapi-call-node/provider/src/main/resources/vpn-information-update.json create mode 100644 restapi-call-node/provider/src/main/resources/vrf-service-configuration-information-template.json create mode 100644 restapi-call-node/provider/src/main/resources/vrf-update-vlan-status-template.json create mode 100644 restapi-call-node/provider/src/main/resources/vrf-update.json create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestJsonParser.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestRestapiCallNode.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlJsonUtil.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlParser.java create mode 100644 restapi-call-node/provider/src/test/resources/test-template.json create mode 100644 restapi-call-node/provider/src/test/resources/test.json create mode 100644 restapi-call-node/provider/src/test/resources/test.xml create mode 100644 restapi-call-node/provider/src/test/resources/test3.xml (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml new file mode 100755 index 000000000..f864c2914 --- /dev/null +++ b/restapi-call-node/provider/pom.xml @@ -0,0 +1,101 @@ + + + 4.0.0 + + org.onap.ccsdk.sli.plugins + restapi-call-node + 0.0.1-SNAPSHOT + + org.onap.ccsdk.sli.plugins + restapi-call-node-provider + 0.0.1-SNAPSHOT + bundle + RESTAPI Call Node - Provider + http://maven.apache.org + + UTF-8 + + + + junit + junit + test + + + org.springframework + spring-test + ${spring.version} + test + + + org.onap.ccsdk.sli.core + sli-common + ${sdnctl.sli.version} + compile + + + org.onap.ccsdk.sli.core + sli-provider + ${sdnctl.sli.version} + compile + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + com.sun.jersey + jersey-client + ${jersey.version} + provided + + + org.codehaus.jettison + jettison + ${jettison.version} + provided + + + + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.onap.ccsdk.sli.restapicall + org.openecomp.sdnc.restapicall + * + + + + + + + + + + + + diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java new file mode 100644 index 000000000..52086255f --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +public enum Format { + JSON, XML; + + public static Format fromString(String s) { + if (s == null) + return null; + if (s.equalsIgnoreCase("json")) + return JSON; + if (s.equalsIgnoreCase("xml")) + return XML; + throw new IllegalArgumentException("Invalid value for format: " + s); + } +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpMethod.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpMethod.java new file mode 100644 index 000000000..059074bf9 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpMethod.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +public enum HttpMethod { + GET, POST, PUT, DELETE, PATCH; + + public static HttpMethod fromString(String s) { + if (s == null) + return null; + if (s.equalsIgnoreCase("get")) + return GET; + if (s.equalsIgnoreCase("post")) + return POST; + if (s.equalsIgnoreCase("put")) + return PUT; + if (s.equalsIgnoreCase("delete")) + return DELETE; + if (s.equalsIgnoreCase("patch")) + return PATCH; + throw new IllegalArgumentException("Invalid value for HTTP Method: " + s); + } +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpResponse.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpResponse.java new file mode 100644 index 000000000..761e4264e --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpResponse.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +import javax.ws.rs.core.MultivaluedMap; + +public class HttpResponse { + public int code; + public String message; + public String body; + public MultivaluedMap headers; +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/JsonParser.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/JsonParser.java new file mode 100644 index 000000000..27e9a82ef --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/JsonParser.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.codehaus.jettison.json.JSONArray; +import org.codehaus.jettison.json.JSONException; +import org.codehaus.jettison.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class JsonParser { + + private static final Logger log = LoggerFactory.getLogger(JsonParser.class); + + @SuppressWarnings("unchecked") + public static Map convertToProperties(String s) throws JSONException { + JSONObject json = new JSONObject(s); + + Map wm = new HashMap(); + Iterator ii = json.keys(); + while (ii.hasNext()) { + String key1 = ii.next(); + wm.put(key1, json.get(key1)); + } + + Map mm = new HashMap(); + + while (!wm.isEmpty()) + for (String key : new ArrayList<>(wm.keySet())) { + Object o = wm.get(key); + wm.remove(key); + + if (o instanceof Boolean || o instanceof Number || o instanceof String) { + mm.put(key, o.toString()); + + log.info("Added property: " + key + ": " + o.toString()); + } + + else if (o instanceof JSONObject) { + JSONObject jo = (JSONObject) o; + Iterator i = jo.keys(); + while (i.hasNext()) { + String key1 = i.next(); + wm.put(key + "." + key1, jo.get(key1)); + } + } + + else if (o instanceof JSONArray) { + JSONArray ja = (JSONArray) o; + mm.put(key + "_length", String.valueOf(ja.length())); + + log.info("Added property: " + key + "_length" + ": " + String.valueOf(ja.length())); + + for (int i = 0; i < ja.length(); i++) + wm.put(key + '[' + i + ']', ja.get(i)); + } + } + + return mm; + } +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Parameters.java new file mode 100644 index 000000000..0cba4e6b1 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Parameters.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +import java.util.Set; + +public class Parameters { + public String templateFileName; + public String restapiUrl; + public String restapiUser; + public String restapiPassword; + public Format format; + public String contentType; + public HttpMethod httpMethod; + public String responsePrefix; + public Set listNameList; + public boolean skipSending; + public boolean convertResponse; + public String keyStoreFileName; + public String keyStorePassword; + public String trustStoreFileName; + public String trustStorePassword; + public boolean ssl; + public String customHttpHeaders; + public String partner; + public Boolean dumpHeaders; +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RestapiCallNode.java new file mode 100644 index 000000000..b7598480c --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RestapiCallNode.java @@ -0,0 +1,759 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +import java.io.FileInputStream; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.KeyStore; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.ws.rs.core.EntityTag; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.UriBuilder; + +import org.apache.commons.lang3.StringUtils; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; +import com.sun.jersey.client.urlconnection.HTTPSProperties; + +public class RestapiCallNode implements SvcLogicJavaPlugin { + + private static final Logger log = LoggerFactory.getLogger(RestapiCallNode.class); + + private String uebServers; + private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; + protected RetryPolicyStore retryPolicyStore; + + protected RetryPolicyStore getRetryPolicyStore() { + return retryPolicyStore; + } + + public void setRetryPolicyStore(RetryPolicyStore retryPolicyStore) { + this.retryPolicyStore = retryPolicyStore; + } + + public RestapiCallNode() { + + } + + /** + * Allows Directed Graphs the ability to interact with REST APIs. + * @param parameters HashMap of parameters passed by the DG to this function + * + * + * + * + * + * + * + * + * + * + * + * vpn-information.vrf-details + * + * + * + * + * + * + *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to template file that can be used to build a request/sdncopt/bvc/restapi/templates/vnf_service-configuration-operation_minimal.json
restapiUrlMandatoryurl to send the request tohttps://sdncodl:8543/restconf/operations/L3VNF-API:create-update-vnf-request
restapiUserOptionaluser name to use for http basic authenticationsdnc_ws
restapiPasswordOptionalunencrypted password to use for http basic authenticationplain_password
contentTypeOptionalhttp content type to set in the http headerusually application/json or application/xml
formatOptionalshould match request body formatjson or xml
httpMethodOptionalhttp method to use when sending the requestget post put delete patch
responsePrefixOptionallocation the response will be written to in context memorytmp.restapi.result
listName[i]OptionalUsed for processing XML responses with repeating elements.
skipSendingOptionaltrue or false
convertResponse Optionalwhether the response should be convertedtrue or false
customHttpHeadersOptionala list additional http headers to be passed in, follow the format in the exampleX-CSI-MessageId=messageId,headerFieldName=headerFieldValue
dumpHeadersOptionalwhen true writes http header content to context memorytrue or false
partnerOptionalneeded for DME2 callsdme2proxy
+ * @param ctx Reference to context memory + * @throws SvcLogicException + * @since 11.0.2 + * @see String#split(String, int) + */ + public void sendRequest(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + sendRequest(paramMap, ctx, null); + } + + public void sendRequest(Map paramMap, SvcLogicContext ctx, Integer retryCount) + throws SvcLogicException { + + RetryPolicy retryPolicy = null; + HttpResponse r = null; + try { + Parameters p = getParameters(paramMap); + if (p.partner != null) { + retryPolicy = retryPolicyStore.getRetryPolicy(p.partner); + } + String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; + + String req = null; + if (p.templateFileName != null) { + String reqTemplate = readFile(p.templateFileName); + req = buildXmlJsonRequest(ctx, reqTemplate, p.format); + } + r = sendHttpRequest(req, p); + setResponseStatus(ctx, p.responsePrefix, r); + + if (p.dumpHeaders && r.headers != null) { + for (Entry> a : r.headers.entrySet()) { + ctx.setAttribute(pp + "header." + a.getKey(), StringUtils.join(a.getValue(), ",")); + } + } + + if (r.body != null && r.body.trim().length() > 0) { + ctx.setAttribute(pp + "httpResponse", r.body); + + if (p.convertResponse) { + Map mm = null; + if (p.format == Format.XML) + mm = XmlParser.convertToProperties(r.body, p.listNameList); + else if (p.format == Format.JSON) + mm = JsonParser.convertToProperties(r.body); + + if (mm != null) + for (String key : mm.keySet()) + ctx.setAttribute(pp + key, mm.get(key)); + } + } + } catch (Exception e) { + boolean shouldRetry = false; + if (e.getCause() instanceof java.net.SocketException) { + shouldRetry = true; + } + + log.error("Error sending the request: " + e.getMessage(), e); + String prefix = parseParam(paramMap, "responsePrefix", false, null); + if (retryPolicy == null || shouldRetry == false) { + setFailureResponseStatus(ctx, prefix, e.getMessage(), r); + } else { + if (retryCount == null) { + retryCount = 0; + } + String retryMessage = retryCount + " attempts were made out of " + retryPolicy.getMaximumRetries() + + " maximum retries."; + log.debug(retryMessage); + try { + retryCount = retryCount + 1; + if (retryCount < retryPolicy.getMaximumRetries() + 1) { + URI uri = new URI(paramMap.get("restapiUrl")); + String hostname = uri.getHost(); + String retryString = retryPolicy.getNextHostName((uri.toString())); + URI uriTwo = new URI(retryString); + URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port(uriTwo.getPort()).scheme( + uriTwo.getScheme()).build(); + paramMap.put("restapiUrl", retryUri.toString()); + log.debug("URL was set to " + retryUri.toString()); + log.debug("Failed to communicate with host " + hostname + + ". Request will be re-attempted using the host " + retryString + "."); + log.debug("This is retry attempt " + retryCount + " out of " + retryPolicy.getMaximumRetries()); + sendRequest(paramMap, ctx, retryCount); + } else { + log.debug("Maximum retries reached, calling setFailureResponseStatus."); + setFailureResponseStatus(ctx, prefix, e.getMessage(), r); + } + } catch (Exception ex) { + log.error("Could not attempt retry.", ex); + String retryErrorMessage = + "Retry attempt has failed. No further retry shall be attempted, calling setFailureResponseStatus."; + setFailureResponseStatus(ctx, prefix, retryErrorMessage, r); + } + } + } + + if (r != null && r.code >= 300) + throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); + } + + protected Parameters getParameters(Map paramMap) throws SvcLogicException { + Parameters p = new Parameters(); + p.templateFileName = parseParam(paramMap, "templateFileName", false, null); + p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); + p.restapiUser = parseParam(paramMap, "restapiUser", false, null); + p.restapiPassword = parseParam(paramMap, "restapiPassword", false, null); + p.contentType = parseParam(paramMap, "contentType", false, null); + p.format = Format.fromString(parseParam(paramMap, "format", false, "json")); + p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); + p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + p.listNameList = getListNameList(paramMap); + String skipSendingStr = paramMap.get("skipSending"); + p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + p.convertResponse = Boolean.valueOf(parseParam(paramMap, "convertResponse", false, "true")); + p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", false, null); + p.trustStorePassword = parseParam(paramMap, "trustStorePassword", false, null); + p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", false, null); + p.keyStorePassword = parseParam(paramMap, "keyStorePassword", false, null); + p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null && p.keyStoreFileName != null && + p.keyStorePassword != null; + p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null); + p.partner = parseParam(paramMap, "partner", false, null); + p.dumpHeaders = Boolean.valueOf(parseParam(paramMap, "dumpHeaders", false, null)); + return p; + } + + protected Set getListNameList(Map paramMap) { + Set ll = new HashSet(); + for (String key : paramMap.keySet()) + if (key.startsWith("listName")) + ll.add(paramMap.get(key)); + return ll; + } + + protected String parseParam(Map paramMap, String name, boolean required, String def) + throws SvcLogicException { + String s = paramMap.get(name); + + if (s == null || s.trim().length() == 0) { + if (!required) + return def; + throw new SvcLogicException("Parameter " + name + " is required in RestapiCallNode"); + } + + s = s.trim(); + String value = ""; + int i = 0; + int i1 = s.indexOf('%'); + while (i1 >= 0) { + int i2 = s.indexOf('%', i1 + 1); + if (i2 < 0) + break; + + String varName = s.substring(i1 + 1, i2); + String varValue = System.getenv(varName); + if (varValue == null) + varValue = "%" + varName + "%"; + + value += s.substring(i, i1); + value += varValue; + + i = i2 + 1; + i1 = s.indexOf('%', i); + } + value += s.substring(i); + + log.info("Parameter " + name + ": [" + value + "]"); + return value; + } + + protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) { + log.info("Building " + format + " started"); + long t1 = System.currentTimeMillis(); + + template = expandRepeats(ctx, template, 1); + + Map mm = new HashMap<>(); + for (String s : ctx.getAttributeKeySet()) + mm.put(s, ctx.getAttribute(s)); + + StringBuilder ss = new StringBuilder(); + int i = 0; + while (i < template.length()) { + int i1 = template.indexOf("${", i); + if (i1 < 0) { + ss.append(template.substring(i)); + break; + } + + int i2 = template.indexOf('}', i1 + 2); + if (i2 < 0) + throw new RuntimeException("Template error: Matching } not found"); + + String var1 = template.substring(i1 + 2, i2); + String value1 = format == Format.XML ? XmlJsonUtil.getXml(mm, var1) : XmlJsonUtil.getJson(mm, var1); + // log.info(" " + var1 + ": " + value1); + if (value1 == null || value1.trim().length() == 0) { + // delete the whole element (line) + int i3 = template.lastIndexOf('\n', i1); + if (i3 < 0) + i3 = 0; + int i4 = template.indexOf('\n', i1); + if (i4 < 0) + i4 = template.length(); + + if (i < i3) + ss.append(template.substring(i, i3)); + i = i4; + } else { + ss.append(template.substring(i, i1)).append(value1); + i = i2 + 1; + } + } + + String req = format == Format.XML + ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) : XmlJsonUtil.removeEmptyStructJson(ss.toString()); + + if (format == Format.JSON) + req = XmlJsonUtil.removeLastCommaJson(req); + + long t2 = System.currentTimeMillis(); + log.info("Building " + format + " completed. Time: " + (t2 - t1)); + + return req; + } + + protected String expandRepeats(SvcLogicContext ctx, String template, int level) { + StringBuilder newTemplate = new StringBuilder(); + int k = 0; + while (k < template.length()) { + int i1 = template.indexOf("${repeat:", k); + if (i1 < 0) { + newTemplate.append(template.substring(k)); + break; + } + + int i2 = template.indexOf(':', i1 + 9); + if (i2 < 0) + throw new RuntimeException( + "Template error: Context variable name followed by : is required after repeat"); + + // Find the closing }, store in i3 + int nn = 1; + int i3 = -1; + int i = i2; + while (nn > 0 && i < template.length()) { + i3 = template.indexOf('}', i); + if (i3 < 0) + throw new RuntimeException("Template error: Matching } not found"); + int i32 = template.indexOf('{', i); + if (i32 >= 0 && i32 < i3) { + nn++; + i = i32 + 1; + } else { + nn--; + i = i3 + 1; + } + } + + String var1 = template.substring(i1 + 9, i2); + String value1 = ctx.getAttribute(var1); + log.info(" " + var1 + ": " + value1); + int n = 0; + try { + n = Integer.parseInt(value1); + } catch (Exception e) { + n = 0; + } + + newTemplate.append(template.substring(k, i1)); + + String rpt = template.substring(i2 + 1, i3); + + for (int ii = 0; ii < n; ii++) { + String ss = rpt.replaceAll("\\[\\$\\{" + level + "\\}\\]", "[" + ii + "]"); + if (ii == n - 1 && ss.trim().endsWith(",")) { + int i4 = ss.lastIndexOf(','); + if (i4 > 0) + ss = ss.substring(0, i4) + ss.substring(i4 + 1); + } + newTemplate.append(ss); + } + + k = i3 + 1; + } + + if (k == 0) + return newTemplate.toString(); + + return expandRepeats(ctx, newTemplate.toString(), level + 1); + } + + protected String readFile(String fileName) throws Exception { + byte[] encoded = Files.readAllBytes(Paths.get(fileName)); + return new String(encoded, "UTF-8"); + } + + protected HttpResponse sendHttpRequest(String request, Parameters p) throws Exception { + ClientConfig config = new DefaultClientConfig(); + SSLContext ssl = null; + if (p.ssl && p.restapiUrl.startsWith("https")) + ssl = createSSLContext(p); + if (ssl != null) { + HostnameVerifier hostnameVerifier = new HostnameVerifier() { + + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + + config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, + new HTTPSProperties(hostnameVerifier, ssl)); + } + + logProperties(config.getProperties()); + + Client client = Client.create(config); + client.setConnectTimeout(5000); + if (p.restapiUser != null) + client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); + WebResource webResource = client.resource(p.restapiUrl); + + log.info("Sending request:"); + log.info(request); + long t1 = System.currentTimeMillis(); + + HttpResponse r = new HttpResponse(); + r.code = 200; + + if (!p.skipSending) { + String tt = p.format == Format.XML ? "application/xml" : "application/json"; + String tt1 = tt + ";charset=UTF-8"; + if (p.contentType != null) { + tt = p.contentType; + tt1 = p.contentType; + } + + WebResource.Builder webResourceBuilder = webResource.accept(tt).type(tt1); + + if (p.customHttpHeaders != null && p.customHttpHeaders.length() > 0) { + String[] keyValuePairs = p.customHttpHeaders.split(","); + for (String singlePair : keyValuePairs) { + int equalPosition = singlePair.indexOf('='); + webResourceBuilder.header(singlePair.substring(0, equalPosition), singlePair.substring(equalPosition + 1, singlePair.length())); + } + } + + webResourceBuilder.header("X-ECOMP-RequestID",org.slf4j.MDC.get("X-ECOMP-RequestID")); + + ClientResponse response = webResourceBuilder.method(p.httpMethod.toString(), ClientResponse.class, request); + + r.code = response.getStatus(); + r.headers = response.getHeaders(); + EntityTag etag = response.getEntityTag(); + if (etag != null) + r.message = etag.getValue(); + if (response.hasEntity() && r.code != 204) + r.body = response.getEntity(String.class); + } + + long t2 = System.currentTimeMillis(); + log.info("Response received. Time: " + (t2 - t1)); + log.info("HTTP response code: " + r.code); + log.info("HTTP response message: " + r.message); + logHeaders(r.headers); + log.info("HTTP response: " + r.body); + + return r; + } + + protected SSLContext createSSLContext(Parameters p) { + try { + System.setProperty("jsse.enableSNIExtension", "false"); + System.setProperty("javax.net.ssl.trustStore", p.trustStoreFileName); + System.setProperty("javax.net.ssl.trustStorePassword", p.trustStorePassword); + + HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { + + @Override + public boolean verify(String string, SSLSession ssls) { + return true; + } + }); + + KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + FileInputStream in = new FileInputStream(p.keyStoreFileName); + KeyStore ks = KeyStore.getInstance("PKCS12"); + char[] pwd = p.keyStorePassword.toCharArray(); + ks.load(in, pwd); + kmf.init(ks, pwd); + + SSLContext ctx = SSLContext.getInstance("TLS"); + ctx.init(kmf.getKeyManagers(), null, null); + return ctx; + } catch (Exception e) { + log.error("Error creating SSLContext: " + e.getMessage(), e); + } + return null; + } + + protected void setFailureResponseStatus(SvcLogicContext ctx, String prefix, String errorMessage, HttpResponse r) { + r = new HttpResponse(); + r.code = 500; + r.message = errorMessage; + String pp = prefix != null ? prefix + '.' : ""; + ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); + ctx.setAttribute(pp + "response-message", r.message); + } + + protected void setResponseStatus(SvcLogicContext ctx, String prefix, HttpResponse r) { + String pp = prefix != null ? prefix + '.' : ""; + ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); + ctx.setAttribute(pp + "response-message", r.message); + } + + public void sendFile(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + HttpResponse r = null; + try { + FileParam p = getFileParameters(paramMap); + byte[] data = Files.readAllBytes(Paths.get(p.fileName)); + + r = sendHttpData(data, p); + setResponseStatus(ctx, p.responsePrefix, r); + + } catch (Exception e) { + log.error("Error sending the request: " + e.getMessage(), e); + + r = new HttpResponse(); + r.code = 500; + r.message = e.getMessage(); + String prefix = parseParam(paramMap, "responsePrefix", false, null); + setResponseStatus(ctx, prefix, r); + } + + if (r != null && r.code >= 300) + throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); + } + + private static class FileParam { + + public String fileName; + public String url; + public String user; + public String password; + public HttpMethod httpMethod; + public String responsePrefix; + public boolean skipSending; + } + + private FileParam getFileParameters(Map paramMap) throws SvcLogicException { + FileParam p = new FileParam(); + p.fileName = parseParam(paramMap, "fileName", true, null); + p.url = parseParam(paramMap, "url", true, null); + p.user = parseParam(paramMap, "user", false, null); + p.password = parseParam(paramMap, "password", false, null); + p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); + p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + String skipSendingStr = paramMap.get("skipSending"); + p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + return p; + } + + protected HttpResponse sendHttpData(byte[] data, FileParam p) { + Client client = Client.create(); + client.setConnectTimeout(5000); + client.setFollowRedirects(true); + if (p.user != null) + client.addFilter(new HTTPBasicAuthFilter(p.user, p.password)); + WebResource webResource = client.resource(p.url); + + log.info("Sending file"); + long t1 = System.currentTimeMillis(); + + HttpResponse r = new HttpResponse(); + r.code = 200; + + if (!p.skipSending) { + String tt = "application/octet-stream"; + + ClientResponse response = null; + if (p.httpMethod == HttpMethod.POST) + response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); + else if (p.httpMethod == HttpMethod.PUT) + response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); + + r.code = response.getStatus(); + r.headers = response.getHeaders(); + EntityTag etag = response.getEntityTag(); + if (etag != null) + r.message = etag.getValue(); + if (response.hasEntity() && r.code != 204) + r.body = response.getEntity(String.class); + + if (r.code == 301) { + String newUrl = response.getHeaders().getFirst("Location"); + + log.info("Got response code 301. Sending same request to URL: " + newUrl); + + webResource = client.resource(newUrl); + + if (p.httpMethod == HttpMethod.POST) + response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); + else if (p.httpMethod == HttpMethod.PUT) + response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); + + r.code = response.getStatus(); + etag = response.getEntityTag(); + if (etag != null) + r.message = etag.getValue(); + if (response.hasEntity() && r.code != 204) + r.body = response.getEntity(String.class); + } + } + + long t2 = System.currentTimeMillis(); + log.info("Response received. Time: " + (t2 - t1)); + log.info("HTTP response code: " + r.code); + log.info("HTTP response message: " + r.message); + logHeaders(r.headers); + log.info("HTTP response: " + r.body); + + return r; + } + + public void postMessageOnUeb(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + HttpResponse r = null; + try { + UebParam p = getUebParameters(paramMap); + + String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; + + String req = null; + + if (p.templateFileName == null) { + log.info("No template file name specified. Using default UEB template: " + defaultUebTemplateFileName); + p.templateFileName = defaultUebTemplateFileName; + } + + String reqTemplate = readFile(p.templateFileName); + reqTemplate = reqTemplate.replaceAll("rootVarName", p.rootVarName); + req = buildXmlJsonRequest(ctx, reqTemplate, Format.JSON); + + r = postOnUeb(req, p); + setResponseStatus(ctx, p.responsePrefix, r); + if (r.body != null) + ctx.setAttribute(pp + "httpResponse", r.body); + + } catch (Exception e) { + log.error("Error sending the request: " + e.getMessage(), e); + + r = new HttpResponse(); + r.code = 500; + r.message = e.getMessage(); + String prefix = parseParam(paramMap, "responsePrefix", false, null); + setResponseStatus(ctx, prefix, r); + } + + if (r != null && r.code >= 300) + throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); + } + + private static class UebParam { + + public String topic; + public String templateFileName; + public String rootVarName; + public String responsePrefix; + public boolean skipSending; + } + + private UebParam getUebParameters(Map paramMap) throws SvcLogicException { + UebParam p = new UebParam(); + p.topic = parseParam(paramMap, "topic", true, null); + p.templateFileName = parseParam(paramMap, "templateFileName", false, null); + p.rootVarName = parseParam(paramMap, "rootVarName", false, null); + p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + String skipSendingStr = paramMap.get("skipSending"); + p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + return p; + } + + protected HttpResponse postOnUeb(String request, UebParam p) throws Exception { + String[] urls = uebServers.split(" "); + for (int i = 0; i < urls.length; i++) { + if (!urls[i].endsWith("/")) + urls[i] += "/"; + urls[i] += "events/" + p.topic; + } + + Client client = Client.create(); + client.setConnectTimeout(5000); + WebResource webResource = client.resource(urls[0]); + + log.info("UEB URL: " + urls[0]); + log.info("Sending request:"); + log.info(request); + long t1 = System.currentTimeMillis(); + + HttpResponse r = new HttpResponse(); + r.code = 200; + + if (!p.skipSending) { + String tt = "application/json"; + String tt1 = tt + ";charset=UTF-8"; + + ClientResponse response = webResource.accept(tt).type(tt1).post(ClientResponse.class, request); + + r.code = response.getStatus(); + r.headers = response.getHeaders(); + if (response.hasEntity()) + r.body = response.getEntity(String.class); + } + + long t2 = System.currentTimeMillis(); + log.info("Response received. Time: " + (t2 - t1)); + log.info("HTTP response code: " + r.code); + logHeaders(r.headers); + log.info("HTTP response:\n" + r.body); + + return r; + } + + protected void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + String.valueOf(mm.get(name))); + } + + protected void logHeaders(MultivaluedMap mm) { + log.info("HTTP response headers:"); + + if (mm == null) + return; + + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + for (String name : ll) + log.info("--- " + name + ": " + String.valueOf(mm.get(name))); + } + + public void setUebServers(String uebServers) { + this.uebServers = uebServers; + } + + public void setDefaultUebTemplateFileName(String defaultUebTemplateFileName) { + this.defaultUebTemplateFileName = defaultUebTemplateFileName; + } +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryException.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryException.java new file mode 100644 index 000000000..bf6ccc056 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryException.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +public class RetryException extends Exception { + + public RetryException(String message) { + super(message); + } + +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicy.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicy.java new file mode 100644 index 000000000..2a27a1d02 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicy.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +public class RetryPolicy { + private String[] hostnames; + private Integer maximumRetries; + + public Integer getMaximumRetries() { + return maximumRetries; + } + + public String getNextHostName(String uri) throws RetryException { + Integer position = null; + + for (int i = 0; i < hostnames.length; i++) { + if (uri.contains(hostnames[i])) { + position = i; + break; + } + } + + if(position == null){ + throw new RetryException("No match found for the provided uri[" + uri + "] so the next host name could not be retreived"); + } + position++; + + if (position > hostnames.length - 1) { + position = 0; + } + return hostnames[position]; + } + + public RetryPolicy(String[] hostnames, Integer maximumRetries){ + this.hostnames = hostnames; + this.maximumRetries = maximumRetries; + } + + +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicyStore.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicyStore.java new file mode 100644 index 000000000..baf60d2e8 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicyStore.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +import java.util.HashMap; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RetryPolicyStore { + private static final Logger log = LoggerFactory.getLogger(RetryPolicyStore.class); + + HashMap retryPolicies; + public String proxyServers; + + public String getProxyServers() { + return proxyServers; + } + + public void setProxyServers(String admServers) { + this.proxyServers = admServers; + String[] adminServersArray = admServers.split(","); + RetryPolicy adminPortalRetry = new RetryPolicy(adminServersArray, adminServersArray.length); + retryPolicies.put("dme2proxy", adminPortalRetry); + } + + public RetryPolicyStore() { + retryPolicies = new HashMap(); + } + + public RetryPolicy getRetryPolicy(String policyName) { + return (this.retryPolicies.get(policyName)); + } + +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlJsonUtil.java new file mode 100644 index 000000000..66bf08b3d --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlJsonUtil.java @@ -0,0 +1,372 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class XmlJsonUtil { + + private static final Logger log = LoggerFactory.getLogger(XmlJsonUtil.class); + + public static String getXml(Map varmap, String var) { + boolean escape = true; + if (var.startsWith("'")) { + var = var.substring(1); + escape = false; + } + + Object o = createStructure(varmap, var); + return generateXml(o, 0, escape); + } + + public static String getJson(Map varmap, String var) { + boolean escape = true; + if (var.startsWith("'")) { + var = var.substring(1); + escape = false; + } + + Object o = createStructure(varmap, var); + return generateJson(o, escape); + } + + private static Object createStructure(Map flatmap, String var) { + if (flatmap.containsKey(var)) { + if (var.endsWith("_length") || var.endsWith("].key")) + return null; + return flatmap.get(var); + } + + Map mm = new HashMap<>(); + for (String k : flatmap.keySet()) + if (k.startsWith(var + ".")) { + int i1 = k.indexOf('.', var.length() + 1); + int i2 = k.indexOf('[', var.length() + 1); + int i3 = k.length(); + if (i1 > 0 && i1 < i3) + i3 = i1; + if (i2 > 0 && i2 < i3) + i3 = i2; + String k1 = k.substring(var.length() + 1, i3); + String var1 = k.substring(0, i3); + if (!mm.containsKey(k1)) { + Object str = createStructure(flatmap, var1); + if (str != null && (!(str instanceof String) || ((String) str).trim().length() > 0)) + mm.put(k1, str); + } + } + if (!mm.isEmpty()) + return mm; + + boolean arrayFound = false; + for (String k : flatmap.keySet()) + if (k.startsWith(var + "[")) { + arrayFound = true; + break; + } + + if (arrayFound) { + List ll = new ArrayList<>(); + + int length = Integer.MAX_VALUE; + String lengthStr = flatmap.get(var + "_length"); + if (lengthStr != null) { + try { + length = Integer.parseInt(lengthStr); + } catch (Exception e) { + log.warn("Invalid number for " + var + "_length:" + lengthStr); + } + } + + for (int i = 0; i < length; i++) { + Object v = createStructure(flatmap, var + '[' + i + ']'); + if (v == null) + break; + ll.add(v); + } + + if (!ll.isEmpty()) + return ll; + } + + return null; + } + + @SuppressWarnings("unchecked") + private static String generateXml(Object o, int indent, boolean escape) { + if (o == null) + return null; + + if (o instanceof String) + return escape ? escapeXml((String) o) : (String) o;; + + if (o instanceof Map) { + StringBuilder ss = new StringBuilder(); + Map mm = (Map) o; + for (String k : mm.keySet()) { + Object v = mm.get(k); + if (v instanceof String) { + String s = escape ? escapeXml((String) v) : (String) v; + ss.append(pad(indent)).append('<').append(k).append('>'); + ss.append(s); + ss.append("').append('\n'); + } else if (v instanceof Map) { + ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); + ss.append(generateXml(v, indent + 1, escape)); + ss.append(pad(indent)).append("').append('\n'); + } else if (v instanceof List) { + List ll = (List) v; + for (Object o1 : ll) { + ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); + ss.append(generateXml(o1, indent + 1, escape)); + ss.append(pad(indent)).append("').append('\n'); + } + } + } + return ss.toString(); + } + + return null; + } + + private static String generateJson(Object o, boolean escape) { + if (o == null) + return null; + + StringBuilder ss = new StringBuilder(); + generateJson(ss, o, 0, false, escape); + return ss.toString(); + } + + @SuppressWarnings("unchecked") + private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape) { + if (o instanceof String) { + String s = escape ? escapeJson((String) o) : (String) o; + if (padFirst) + ss.append(pad(indent)); + ss.append('"').append(s).append('"'); + return; + } + + if (o instanceof Map) { + Map mm = (Map) o; + + if (padFirst) + ss.append(pad(indent)); + ss.append("{\n"); + + boolean first = true; + for (String k : mm.keySet()) { + if (!first) + ss.append(",\n"); + first = false; + + Object v = mm.get(k); + ss.append(pad(indent + 1)).append('"').append(k).append("\": "); + generateJson(ss, v, indent + 1, false, escape); + } + + ss.append("\n"); + ss.append(pad(indent)).append('}'); + + return; + } + + if (o instanceof List) { + List ll = (List) o; + + if (padFirst) + ss.append(pad(indent)); + ss.append("[\n"); + + boolean first = true; + for (Object o1 : ll) { + if (!first) + ss.append(",\n"); + first = false; + + generateJson(ss, o1, indent + 1, true, escape); + } + + ss.append("\n"); + ss.append(pad(indent)).append(']'); + } + } + + public static String removeLastCommaJson(String s) { + StringBuilder sb = new StringBuilder(); + int k = 0; + int start = 0; + while (k < s.length()) { + int i11 = s.indexOf('}', k); + int i12 = s.indexOf(']', k); + int i1 = -1; + if (i11 < 0) + i1 = i12; + else if (i12 < 0) + i1 = i11; + else + i1 = i11 < i12 ? i11 : i12; + if (i1 < 0) + break; + + int i2 = s.lastIndexOf(',', i1); + if (i2 < 0) { + k = i1 + 1; + continue; + } + + String between = s.substring(i2 + 1, i1); + if (between.trim().length() > 0) { + k = i1 + 1; + continue; + } + + sb.append(s.substring(start, i2)); + start = i2 + 1; + k = i1 + 1; + } + + sb.append(s.substring(start, s.length())); + + return sb.toString(); + } + + public static String removeEmptyStructJson(String s) { + int k = 0; + while (k < s.length()) { + boolean curly = true; + int i11 = s.indexOf('{', k); + int i12 = s.indexOf('[', k); + int i1 = -1; + if (i11 < 0) { + i1 = i12; + curly = false; + } else if (i12 < 0) + i1 = i11; + else + if (i11 < i12) + i1 = i11; + else { + i1 = i12; + curly = false; + } + + if (i1 >= 0) { + int i2 = curly ? s.indexOf('}', i1) : s.indexOf(']', i1); + if (i2 > 0) { + String value = s.substring(i1 + 1, i2); + if (value.trim().length() == 0) { + int i4 = s.lastIndexOf('\n', i1); + if (i4 < 0) + i4 = 0; + int i5 = s.indexOf('\n', i2); + if (i5 < 0) + i5 = s.length(); + + s = s.substring(0, i4) + s.substring(i5); + k = 0; + } else + k = i1 + 1; + } else + break; + } else + break; + } + + return s; + } + + public static String removeEmptyStructXml(String s) { + int k = 0; + while (k < s.length()) { + int i1 = s.indexOf('<', k); + if (i1 < 0 || i1 == s.length() - 1) + break; + + char c1 = s.charAt(i1 + 1); + if (c1 == '?' || c1 == '!') { + k = i1 + 2; + continue; + } + + int i2 = s.indexOf('>', i1); + if (i2 < 0) { + k = i1 + 1; + continue; + } + + String closingTag = " 0) { + k = i2 + 1; + continue; + } + + int i4 = s.lastIndexOf('\n', i1); + if (i4 < 0) + i4 = 0; + int i5 = s.indexOf('\n', i3); + if (i5 < 0) + i5 = s.length(); + + s = s.substring(0, i4) + s.substring(i5); + k = 0; + } + + return s; + } + + private static String escapeXml(String v) { + String s = v.replaceAll("&", "&"); + s = s.replaceAll("<", "<"); + s = s.replaceAll("'", "'"); + s = s.replaceAll("\"", """); + s = s.replaceAll(">", ">"); + return s; + } + + private static String escapeJson(String v) { + String s = v.replaceAll("\\\\", "\\\\\\\\"); + s = s.replaceAll("\"", "\\\\\""); + return s; + } + + private static String pad(int n) { + String s = ""; + for (int i = 0; i < n; i++) + s += '\t'; + return s; + } +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlParser.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlParser.java new file mode 100644 index 000000000..e90a44fb8 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlParser.java @@ -0,0 +1,160 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdnc.restapicall; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public class XmlParser { + + private static final Logger log = LoggerFactory.getLogger(XmlParser.class); + + public static Map convertToProperties(String s, Set listNameList) { + Handler handler = new Handler(listNameList); + try { + SAXParserFactory factory = SAXParserFactory.newInstance(); + SAXParser saxParser = factory.newSAXParser(); + InputStream in = new ByteArrayInputStream(s.getBytes()); + saxParser.parse(in, handler); + } catch (Exception e) { + e.printStackTrace(); + } + + return handler.getProperties(); + } + + private static class Handler extends DefaultHandler { + + private Set listNameList; + + private Map properties = new HashMap<>(); + + public Map getProperties() { + return properties; + } + + public Handler(Set listNameList) { + super(); + this.listNameList = listNameList; + if (this.listNameList == null) + this.listNameList = new HashSet(); + } + + String currentName = ""; + String currentValue = ""; + + @Override + public void startElement(String uri, String localName, String qName, Attributes attributes) + throws SAXException { + super.startElement(uri, localName, qName, attributes); + + String name = localName; + if (name == null || name.trim().length() == 0) + name = qName; + int i2 = name.indexOf(':'); + if (i2 >= 0) + name = name.substring(i2 + 1); + + if (currentName.length() > 0) + currentName += '.'; + currentName += name; + + String listName = removeIndexes(currentName); + + if (listNameList.contains(listName)) { + int len = getInt(properties, currentName + "_length"); + properties.put(currentName + "_length", String.valueOf(len + 1)); + currentName += "[" + len + "]"; + } + } + + @Override + public void endElement(String uri, String localName, String qName) throws SAXException { + super.endElement(uri, localName, qName); + + String name = localName; + if (name == null || name.trim().length() == 0) + name = qName; + int i2 = name.indexOf(':'); + if (i2 >= 0) + name = name.substring(i2 + 1); + + if (currentValue.trim().length() > 0) { + currentValue = currentValue.trim(); + properties.put(currentName, currentValue); + + log.info("Added property: " + currentName + ": " + currentValue); + + currentValue = ""; + } + + int i1 = currentName.lastIndexOf("." + name); + if (i1 <= 0) + currentName = ""; + else + currentName = currentName.substring(0, i1); + } + + @Override + public void characters(char[] ch, int start, int length) throws SAXException { + super.characters(ch, start, length); + + String value = new String(ch, start, length); + currentValue += value; + } + + private static int getInt(Map mm, String name) { + String s = mm.get(name); + if (s == null) + return 0; + return Integer.parseInt(s); + } + + private String removeIndexes(String currentName) { + String s = ""; + boolean add = true; + for (int i = 0; i < currentName.length(); i++) { + char c = currentName.charAt(i); + if (c == '[') + add = false; + else if (c == ']') + add = true; + else if (add) + s += c; + } + return s; + } + } +} diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml new file mode 100644 index 000000000..a7b1a8923 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml @@ -0,0 +1,49 @@ + + + + + + + + + file:${SDNC_CONFIG_DIR}/ueb.properties + file:${SDNC_CONFIG_DIR}/dme2.properties + + + + + + + + + + + + + + + + + diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml new file mode 100644 index 000000000..09e3de783 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/restapi-call-node/provider/src/main/resources/default-ueb-message.json b/restapi-call-node/provider/src/main/resources/default-ueb-message.json new file mode 100644 index 000000000..4b1aa0386 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/default-ueb-message.json @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "event":{ + "header":{ + "eventSource":"sdn-c" + }, + "body": + +${rootVarName} + + } +} diff --git a/restapi-call-node/provider/src/main/resources/get-multicast-data.json b/restapi-call-node/provider/src/main/resources/get-multicast-data.json new file mode 100644 index 000000000..f6155ee32 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/get-multicast-data.json @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "input": { + "sdnc-request-header": { + "svc-request-id": ${connection-details-notification-input.configuration-response-common.svc-request-id}, + "svc-action": "updatemulticastvpn" + }, + "service-information": { + "service-type": "AVPN", + "service-instance-id": ${tmp.ete-vpn-key} + } + } +} + diff --git a/restapi-call-node/provider/src/main/resources/northbound-api-template.json b/restapi-call-node/provider/src/main/resources/northbound-api-template.json new file mode 100644 index 000000000..d48c41ce9 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/northbound-api-template.json @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ +"input": + { + "sdnc-request-header":{ + "svc-request-id": ${service-topology-operation-input.sdnc-request-header.svc-request-id}, + "svc-notification-url": ${service-topology-operation-input.sdnc-request-header.svc-notification-url} + }, + "request-information":{ + "request-id": ${service-topology-operation-input.request-information.request-id}, + "request-action": ${service-topology-operation-input.request-information.request-action}, + "request-sub-action": ${service-topology-operation-input.request-information.request-sub-action}, + "source": ${service-topology-operation-input.request-information.source}, + "notification-url": ${service-topology-operation-input.request-information.notification-url} + }, + "service-information":{ + "service-type": ${service-topology-operation-input.service-information.service-type}, + "service-instance-id": ${service-topology-operation-input.service-information.service-instance-id}, + "subscriber-name": ${service-topology-operation-input.service-information.subscriber-name}, + "subscriber-global-id": ${service-topology-operation-input.service-information.subscriber-global-id} + } +} + diff --git a/restapi-call-node/provider/src/main/resources/northbound-api-template.xml b/restapi-call-node/provider/src/main/resources/northbound-api-template.xml new file mode 100644 index 000000000..03530a729 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/northbound-api-template.xml @@ -0,0 +1,43 @@ + + + + <${northbound-Container}> + + ${service-topology-operation-input.request-information.notification-url} + ${service-topology-operation-input.request-information.request-action} + ${service-topology-operation-input.request-information.request-id} + ${service-topology-operation-input.request-information.request-sub-action} + ${service-topology-operation-input.request-information.source} + + + ${service-topology-operation-input.sdnc-request-header.svc-notification-url} + ${service-topology-operation-input.sdnc-request-header.svc-request-id} + + + ${service-topology-operation-input.service-information.service-instance-id} + ${service-topology-operation-input.service-information.service-type} + ${service-topology-operation-input.service-information.subscriber-global-id} + ${service-topology-operation-input.service-information.subscriber-name} + + ${'northbound-anyData} + + diff --git a/restapi-call-node/provider/src/main/resources/service-configuration-notification-northbound-template.json b/restapi-call-node/provider/src/main/resources/service-configuration-notification-northbound-template.json new file mode 100644 index 000000000..0cb7d0b06 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/service-configuration-notification-northbound-template.json @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "input": { + "svc-request-id": ${service-configuration-notification-input.svc-request-id}, + "response-code": ${service-configuration-notification-input.response-code}, + "response-message": ${service-configuration-notification-input.response-message}, + "ack-final-indicator": ${service-configuration-notification-input.ack-final-indicator}, + "service-information": { + "service-type": ${service-data.service-information.service-type}, + "service-instance-id": ${service-data.service-information.service-instance-id}, + "subscriber-name": ${service-data.service-information.subscriber-name}, + "subscriber-global-id": ${service-data.service-information.subscriber-global-id} + }, + "response-parameters": [ + ${repeat:service-configuration-notification-input.response-parameters_length: + { + "sequence-number": ${service-configuration-notification-input.response-parameters[${1}].sequence-number}, + "tag-name": ${service-configuration-notification-input.response-parameters[${1}].tag-name}, + "tag-value": ${service-configuration-notification-input.response-parameters[${1}].tag-value} + } + } + ] + } +} diff --git a/restapi-call-node/provider/src/main/resources/update-vpe-data-with-apply-group.json b/restapi-call-node/provider/src/main/resources/update-vpe-data-with-apply-group.json new file mode 100644 index 000000000..a82a6b4a6 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/update-vpe-data-with-apply-group.json @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "vrf-export-details": [ + ${repeat:restapi-result.ApplyGroupResponse.ApplyGroupResponseData[0].VrfDetails.VrfExport_length: + { + "vrf-export": ${restapi-result.ApplyGroupResponse.ApplyGroupResponseData[0].VrfDetails.VrfExport[${1}]} + } + } + ], + "vrf-import-details": [ + ${repeat:restapi-result.ApplyGroupResponse.ApplyGroupResponseData[0].VrfDetails.VrfImport_length: + { + "vrf-import": ${restapi-result.ApplyGroupResponse.ApplyGroupResponseData[0].VrfDetails.VrfImport[${1}]} + } + } + ], + "apply-group-template": [ + ${repeat:restapi-result.ApplyGroupResponse.ApplyGroupResponseData[0].VrfDetails.ApplyGroup_length: + { + "apply-group": ${restapi-result.ApplyGroupResponse.ApplyGroupResponseData[0].VrfDetails.ApplyGroup[${1}].ApplyGroup} + } + } + ], + "community-list": [ + ${repeat:restapi-result.ApplyGroupResponse.ApplyGroupResponseData[0].VrfDetails.CommunityList_length: + { + "member": ${restapi-result.ApplyGroupResponse.ApplyGroupResponseData[0].VrfDetails.CommunityList[${1}].member}, + "name": ${restapi-result.ApplyGroupResponse.ApplyGroupResponseData[0].VrfDetails.CommunityList[${1}].name} + } + } + ] +} + diff --git a/restapi-call-node/provider/src/main/resources/vnf-information-update.json b/restapi-call-node/provider/src/main/resources/vnf-information-update.json new file mode 100644 index 000000000..425f0f3d7 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/vnf-information-update.json @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ +"generic-vnf-service" :${vnf-service.generic-vnf-service} +} diff --git a/restapi-call-node/provider/src/main/resources/vpn-allocation-request.json b/restapi-call-node/provider/src/main/resources/vpn-allocation-request.json new file mode 100644 index 000000000..6c8427495 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/vpn-allocation-request.json @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "AllocateVpnResourcesRequest": { + "message-id": "${service-data.oper-status.modify-timestamp}", + "service-instance-id": "${service-data.service-information.service-instance-id}", + "vrf-request-type": { + "vpn-id": "${service-data.avpn-logicalchannel-information.vpn-id}", + "vpn-service": "${service-data.service-information.service-type}", + "e2e-vpn-id": "${service-data.avpn-logicalchannel-information.e2e-vpn-id}", + "vpe-name": "${service-data.avpn-logicalchannel-information.evc-endpoint-information.vpe-name}", + "asn": "${service-data.avpn-logicalchannel-information.carrier-asn}", + "route-group-name": "${service-data.avpn-logicalchannel-information.bgp-options.neighbor-address-information.route-group-name}", + "hub-or-spoke": "${service-data.avpn-logicalchannel-information.hub-or-spoke}" + } + } +} diff --git a/restapi-call-node/provider/src/main/resources/vpn-information-update.json b/restapi-call-node/provider/src/main/resources/vpn-information-update.json new file mode 100644 index 000000000..7977066bd --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/vpn-information-update.json @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ +"vpn-information" :${vpe-vpn-service.vpn-information} +} diff --git a/restapi-call-node/provider/src/main/resources/vrf-service-configuration-information-template.json b/restapi-call-node/provider/src/main/resources/vrf-service-configuration-information-template.json new file mode 100644 index 000000000..f7e843246 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/vrf-service-configuration-information-template.json @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "input": { + + "e2e-vpn-key": ${service-data.avpn-logicalchannel-information.e2e-vpn-id}, + "logical-channel-id": ${service-data.service-information.service-instance-id}, + "vpe-name": ${service-data.avpn-logicalchannel-information.evc-endpoint-information.vpe-name}, + "rpc-action": ${tmp.rpc-action}, + + "vpn-information": ${vpe-vpn-service.vpn-information}, + "vrf-details": ${vpe-vpn-service.vpn-information.vrf-details}, + "vrf-vlan-resources": { + "logical-channel-id": ${service-data.service-information.service-instance-id}, + "logical-channel-status": ${tmp.logical-channel-status} + } + } +} diff --git a/restapi-call-node/provider/src/main/resources/vrf-update-vlan-status-template.json b/restapi-call-node/provider/src/main/resources/vrf-update-vlan-status-template.json new file mode 100644 index 000000000..7a6cab35e --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/vrf-update-vlan-status-template.json @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "input": { + "e2e-vpn-key": ${service-data.avpn-logicalchannel-information.e2e-vpn-id}, + "logical-channel-id": ${service-data.service-information.service-instance-id}, + "vpe-name": ${service-data.avpn-logicalchannel-information.evc-endpoint-information.vpe-name}, + "rpc-action": ${tmp.rpc-action}, + "vrf-vlan-resources": { + "logical-channel-id": ${service-data.service-information.service-instance-id}, + "logical-channel-status": ${tmp.logical-channel-status} + } + } +} diff --git a/restapi-call-node/provider/src/main/resources/vrf-update.json b/restapi-call-node/provider/src/main/resources/vrf-update.json new file mode 100644 index 000000000..778e4b294 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/vrf-update.json @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "vpn-vame": ${allocate-vpn-resource-notification-input.vpn-data[0].vpn-name}, + "vpn-id": ${allocate-vpn-resource-notification-input.vpn-data[0].vpn-id}, + "vrf-details": [ + ${repeat:allocate-vpn-resource-notification-input.vpn-data[0].vrf-information_length: + { + "vrf-export-details": [ + ${repeat:allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].vrf-export-details_length: + { + "vrf-export": ${allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].vrf-export-details[${2}].vrf-export} + } + } + ], + "vrf-name": ${allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].vrf-name}, + "vpe-name": ${allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].vpe-name}, + "vrf-import-details": [ + ${repeat:allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].vrf-import-details_length: + { + "vrf-import": ${allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].vrf-import-details[${2}].vrf-import} + } + } + ], + "apply-group-template": [ + ${repeat:allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].apply-group-template_length: + { + "apply-group": ${allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].apply-group-template[${2}].apply-group} + } + } + ], + "community-list": [ + ${repeat:allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].community-list_length: + { + "member": ${allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].community-list[${2}].name}, + "name": ${allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].community-list[${2}].member} + } + } + ], + "router-distinguisher": ${allocate-vpn-resource-notification-input.vpn-data[0].vrf-information[${1}].router-distinguisher} + } + } + ], + "spoke-routes": { + "route-target": ${allocate-vpn-resource-notification-input.vpn-data[0].spoke-route-target.route-target} + }, + + "route-target-details": [ + ${repeat:allocate-vpn-resource-notification-input.vpn-data[0].route-target-details_length: + { + "route-target": ${allocate-vpn-resource-notification-input.vpn-data[0].route-target-details[${1}].route-target}, + "route-target-type": ${allocate-vpn-resource-notification-input.vpn-data[0].route-target-details[${1}].route-target-type} + } + } + ], + + "e2e-vpn-key": ${allocate-vpn-resource-notification-input.vpn-data[0].e2e-vpn-id} +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestJsonParser.java new file mode 100644 index 000000000..16fa68594 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestJsonParser.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.openecomp.sdnc.restapicall; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.junit.Test; +import org.openecomp.sdnc.restapicall.JsonParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestJsonParser { + + private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); + + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json"))); + String ss = ""; + String line = null; + while ((line = in.readLine()) != null) + ss += line + '\n'; + + Map mm = JsonParser.convertToProperties(ss); + + logProperties(mm); + + in.close(); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestRestapiCallNode.java new file mode 100644 index 000000000..e0e58ad50 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestRestapiCallNode.java @@ -0,0 +1,92 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.openecomp.sdnc.restapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.openecomp.sdnc.restapicall.RestapiCallNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestRestapiCallNode { + + private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); + + + @Test + public void testDelete() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonTemplate() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlJsonUtil.java new file mode 100644 index 000000000..dbcf98a98 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlJsonUtil.java @@ -0,0 +1,215 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.openecomp.sdnc.restapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; +import org.openecomp.sdnc.restapicall.XmlJsonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class TestXmlJsonUtil { + + private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); + + @Test + public void test() { + Map mm = new HashMap<>(); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); + mm.put("service-data.service-information.service-instance-id", "someinstance001"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3_length", "2"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf_length", "1"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); + + mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); + mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); + mm.put("service-data.vnf-config-information.vendor", "Netconf"); + + mm.put("service-data.vnf-config-information.escape-test", "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); + + String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); + log.info(ss); + + ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); + log.info(ss); + } + + @Test + public void testRemoveEmptyStructXml() { + String xmlin = "" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmloutexpected = "" + + "\n" + + " \n" + + " blah\n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } + + @Test + public void testRemoveEmptyStructJson() { + String xmlin = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T3\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T4\":{\r\n" + + " \"T12\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T13\":[ ],\r\n" + + " \"T14\":{\r\n" + + " \"T15\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T16\":{\r\n" + + " \r\n" + + " }\r\n" + + " }\r\n" + + " },\r\n" + + " \"T5\":{\r\n" + + " \"T6\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T7\":[\r\n" + + " \"T8\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T9\":{ },\r\n" + + " \"T10\":\"blah\",\r\n" + + " \"T11\":[\r\n" + + " \r\n" + + " ]\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmloutexpected = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T5\":{\r\n" + + " \"T7\":[\r\n" + + " \"T10\":\"blah\",\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmlout = XmlJsonUtil.removeEmptyStructJson(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlParser.java new file mode 100644 index 000000000..980eded4e --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlParser.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.openecomp.sdnc.restapicall; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.junit.Test; +import org.openecomp.sdnc.restapicall.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestXmlParser { + + private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); + + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml"))); + String ss = ""; + String line = null; + while ((line = in.readLine()) != null) + ss += line + '\n'; + + Set listNameList = new HashSet(); + listNameList.add("project.dependencies.dependency"); + listNameList.add("project.build.plugins.plugin"); + listNameList.add("project.build.plugins.plugin.executions.execution"); + listNameList.add("project.build.pluginManagement.plugins.plugin"); + listNameList.add( + "project.build.pluginManagement.plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); + + Map mm = XmlParser.convertToProperties(ss, listNameList); + + logProperties(mm); + + in.close(); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } +} diff --git a/restapi-call-node/provider/src/test/resources/test-template.json b/restapi-call-node/provider/src/test/resources/test-template.json new file mode 100644 index 000000000..4adc6637a --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/test-template.json @@ -0,0 +1,57 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "sdn-circuit-request": [ + ${repeat:tmp.sdn-circuit-req-row_length: + { + "request-id": ${tmp.sdn-circuit-req-row[${1}].request-id}, + "source-uid": ${tmp.sdn-circuit-req-row[${1}].source-uid}, + "action": ${tmp.sdn-circuit-req-row[${1}].action}, + "request-timestamp": ${tmp.sdn-circuit-req-row[${1}].request-timestamp}, + "update-timestamp": ${tmp.sdn-circuit-req-row[${1}].update-timestamp}, + "request-status": ${tmp.sdn-circuit-req-row[${1}].request-status}, + "processing-status": ${tmp.sdn-circuit-req-row[${1}].processing-status}, + "reason-code": ${tmp.sdn-circuit-req-row[${1}].reason-code}, + "reason-message": ${tmp.sdn-circuit-req-row[${1}].reason-message}, + "customer-code": ${tmp.sdn-circuit-req-row[${1}].customer-code}, + "bundle-id": ${tmp.sdn-circuit-req-row[${1}].bundle-id}, + "router-name-1": ${tmp.sdn-circuit-req-row[${1}].router-name-1}, + "tail-clfi-1": ${tmp.sdn-circuit-req-row[${1}].tail-clfi-1}, + "srg-1": ${tmp.sdn-circuit-req-row[${1}].srg-1}, + "router-name-2": ${tmp.sdn-circuit-req-row[${1}].router-name-2}, + "tail-clfi-2": ${tmp.sdn-circuit-req-row[${1}].tail-clfi-2}, + "srg-2": ${tmp.sdn-circuit-req-row[${1}].srg-2}, + "facility-speed": ${tmp.sdn-circuit-req-row[${1}].facility-speed}, + "facility-speed-units": ${tmp.sdn-circuit-req-row[${1}].facility-speed-units}, + "facility-type": ${tmp.sdn-circuit-req-row[${1}].facility-type}, + "service-clfi": ${tmp.sdn-circuit-req-row[${1}].service-clfi}, + "clci": ${tmp.sdn-circuit-req-row[${1}].clci}, + "wavelength-purpose": ${tmp.sdn-circuit-req-row[${1}].wavelength-purpose}, + "activate-setting": ${tmp.sdn-circuit-req-row[${1}].activate-setting}, + "apply-date": ${tmp.sdn-circuit-req-row[${1}].apply-date}, + "run-id": ${tmp.sdn-circuit-req-row[${1}].run-id}, + "hostname": ${tmp.sdn-circuit-req-row[${1}].hostname}, + "algo-request-reason": ${tmp.sdn-circuit-req-row[${1}].algo-request-reason} + }, + } + ] +} diff --git a/restapi-call-node/provider/src/test/resources/test.json b/restapi-call-node/provider/src/test/resources/test.json new file mode 100644 index 000000000..885e66028 --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/test.json @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "equipment-data": [ + { + "server-count": "4", + "max-server-speed": "1600000", + "number-primary-servers": "2", + "equipment-id": "Server1", + "server-model": "Unknown", + "server-id": "Server1" + } + ], + "resource-state": { + "threshold-value": "1600000", + "last-added": "1605000", + "used": "1605000", + "limit-value": "1920000" + }, + "resource-rule": { + "endpoint-position": "VCE-Cust", + "soft-limit-expression": "0.6 * max-server-speed * number-primary-servers", + "resource-name": "Bandwidth", + "service-model": "DUMMY", + "hard-limit-expression": "max-server-speed * number-primary-servers", + "equipment-level": "Server" + }, + "message": "The provisioned access bandwidth is at or exceeds 50% of the total server capacity." +} diff --git a/restapi-call-node/provider/src/test/resources/test.xml b/restapi-call-node/provider/src/test/resources/test.xml new file mode 100644 index 000000000..76205ddec --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/test.xml @@ -0,0 +1,172 @@ + + + + + 4.0.0 + + org.openecomp.sdnctl + restapi-call-node + 6.0.0-SNAPSHOT + + restapi-call-node-provider + bundle + RESTAPI Call Node - Provider + http://maven.apache.org + + UTF-8 + + + + junit + junit + test + + + org.springframework + spring-test + 3.1.4.RELEASE + test + + + org.openecomp.sdnctl + sli-common + compile + + + org.openecomp.sdnctl + sli-provider + compile + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.springframework + spring-beans + 3.1.4.RELEASE + + + org.springframework + spring-context + 3.1.4.RELEASE + + + xerces + xerces + 2.4.0 + provided + + + com.sun.jersey + jersey-client + 1.17 + + + commons-codec + commons-codec + + + + + + + com.brocade.developer + providermodule-plugin + + org.openecomp.sdnctl + restapi-call-node + + + + process-sources + + process + + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.openecomp.sdnc.restapicall + org.openecomp.sdnc.restapicall + * + + + ${project.basedir}/src/main/resources/META-INF + + + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + com.brocade.developer + + + providermodule-plugin + + + [1.2.0.100-SNAPSHOT,) + + + process + + + + + + + + + + + + + + diff --git a/restapi-call-node/provider/src/test/resources/test3.xml b/restapi-call-node/provider/src/test/resources/test3.xml new file mode 100644 index 000000000..2bf3be356 --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/test3.xml @@ -0,0 +1,82 @@ + + + + + + ICOREPVC-81114561 + + VPNL811182 + 811182 + 21302:811182 + SET_BVOIP_IN + SET6_BVOIP_IN + SET6_DSU + SET_DSU + SET6_MANAGED + SET_MANAGED + SET_LOVRF_COMMUNITY + SET_RESET_LP + + AG_MAX_MCASTROUTES + + + + BGP4_PROTOCOL + v4 + gp_21302:811182 + + AG_L3VPN_EBGP + + + AG_MAX_PREFIX + + + AG_BGP_UNMANAGED + + + AG_BFD_BGP_3000 + + + + BGP4_PROTOCOL + v6 + gp6_21302:811182 + + AG6_L3VPN_EBGP + + + AG6_MAX_PREFIX + + + AG6_BGP_UNMANAGED + + + AG6_BFD_BGP_3000 + + + + 200 + Success + Y + + -- cgit 1.2.3-korg From 4515ffa52bc89b1bf40c791749fe518930441d82 Mon Sep 17 00:00:00 2001 From: "Stilwell, David (stilwelld)" Date: Thu, 10 Aug 2017 00:50:12 +0000 Subject: Refactor plugins to org onap ccsdk Refactor code to use new package name org.onap.ccsdk.sli.plugins Change-Id: Ia5399b21e95d556890aef5ad27437f1ac120ef8d Issue-ID: CCSDK-21 Signed-off-by: Stilwell, David (stilwelld) --- example-settings.xml | 28 +- jenkins-settings.xml | 28 +- pom.xml | 20 +- .../features/src/main/resources/features.xml | 2 +- .../ccsdk/sli/plugins/prop/PropertiesNode.java | 97 +++ .../org/openecomp/sdnc/prop/PropertiesNode.java | 97 --- .../META-INF/spring/properties-node-context.xml | 2 +- .../spring/properties-node-osgi-context.xml | 2 +- .../features/src/main/resources/features.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- .../onap/ccsdk/sli/plugins/restapicall/Format.java | 36 + .../ccsdk/sli/plugins/restapicall/HttpMethod.java | 42 ++ .../sli/plugins/restapicall/HttpResponse.java | 31 + .../ccsdk/sli/plugins/restapicall/JsonParser.java | 85 +++ .../ccsdk/sli/plugins/restapicall/Parameters.java | 46 ++ .../sli/plugins/restapicall/RestapiCallNode.java | 759 +++++++++++++++++++++ .../sli/plugins/restapicall/RetryException.java | 30 + .../ccsdk/sli/plugins/restapicall/RetryPolicy.java | 59 ++ .../sli/plugins/restapicall/RetryPolicyStore.java | 54 ++ .../ccsdk/sli/plugins/restapicall/XmlJsonUtil.java | 372 ++++++++++ .../ccsdk/sli/plugins/restapicall/XmlParser.java | 160 +++++ .../org/openecomp/sdnc/restapicall/Format.java | 36 - .../org/openecomp/sdnc/restapicall/HttpMethod.java | 42 -- .../openecomp/sdnc/restapicall/HttpResponse.java | 31 - .../org/openecomp/sdnc/restapicall/JsonParser.java | 85 --- .../org/openecomp/sdnc/restapicall/Parameters.java | 46 -- .../sdnc/restapicall/RestapiCallNode.java | 759 --------------------- .../openecomp/sdnc/restapicall/RetryException.java | 30 - .../openecomp/sdnc/restapicall/RetryPolicy.java | 59 -- .../sdnc/restapicall/RetryPolicyStore.java | 54 -- .../openecomp/sdnc/restapicall/XmlJsonUtil.java | 372 ---------- .../org/openecomp/sdnc/restapicall/XmlParser.java | 160 ----- .../META-INF/spring/restapi-call-node-context.xml | 4 +- .../spring/restapi-call-node-osgi-context.xml | 2 +- .../sli/plugins/restapicall/TestJsonParser.java | 65 ++ .../plugins/restapicall/TestRestapiCallNode.java | 92 +++ .../sli/plugins/restapicall/TestXmlJsonUtil.java | 215 ++++++ .../sli/plugins/restapicall/TestXmlParser.java | 75 ++ .../openecomp/sdnc/restapicall/TestJsonParser.java | 65 -- .../sdnc/restapicall/TestRestapiCallNode.java | 92 --- .../sdnc/restapicall/TestXmlJsonUtil.java | 215 ------ .../openecomp/sdnc/restapicall/TestXmlParser.java | 75 -- .../provider/src/test/resources/test.xml | 12 +- .../provider/src/test/resources/test3.xml | 4 +- 44 files changed, 2272 insertions(+), 2272 deletions(-) create mode 100644 properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java delete mode 100644 properties-node/provider/src/main/java/org/openecomp/sdnc/prop/PropertiesNode.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryException.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpMethod.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpResponse.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/JsonParser.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Parameters.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RestapiCallNode.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryException.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicy.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicyStore.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlJsonUtil.java delete mode 100644 restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlParser.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestJsonParser.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestRestapiCallNode.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlJsonUtil.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlParser.java (limited to 'restapi-call-node/provider') diff --git a/example-settings.xml b/example-settings.xml index 2e7ce6445..06c84eb6d 100644 --- a/example-settings.xml +++ b/example-settings.xml @@ -13,11 +13,11 @@ - openecomp-release + onap-release - openecomp-release - openecomp-release + onap-release + onap-release https://ecomp-nexus:8443/repository/maven-releases/ true @@ -30,8 +30,8 @@ - openecomp-release - openecomp-release + onap-release + onap-release https://ecomp-nexus:8443/repository/maven-releases/ true @@ -45,11 +45,11 @@ - openecomp-snapshots + onap-snapshots - openecomp-snapshot - openecomp-snapshot + onap-snapshot + onap-snapshot https://ecomp-nexus:8443/repository/maven-snapshots/ false @@ -61,8 +61,8 @@ - openecomp-snapshot - openecomp-snapshot + onap-snapshot + onap-snapshot https://ecomp-nexus:8443/repository/maven-snapshots/ false @@ -137,8 +137,8 @@ - openecomp-release - openecomp-snapshots + onap-release + onap-snapshots opendaylight-release opendaylight-snapshots @@ -150,12 +150,12 @@ PASSWORD - openecomp-release + onap-release USERNAME PASSWORD - openecomp-snapshot + onap-snapshot USERNAME PASSWORD diff --git a/jenkins-settings.xml b/jenkins-settings.xml index 344994f85..88f9805f1 100644 --- a/jenkins-settings.xml +++ b/jenkins-settings.xml @@ -13,11 +13,11 @@ - openecomp-release + onap-release - openecomp-release - openecomp-release + onap-release + onap-release https://ecomp-nexus:8443/repository/maven-releases/ true @@ -30,8 +30,8 @@ - openecomp-release - openecomp-release + onap-release + onap-release https://ecomp-nexus:8443/repository/maven-releases/ true @@ -45,11 +45,11 @@ - openecomp-snapshots + onap-snapshots - openecomp-snapshot - openecomp-snapshot + onap-snapshot + onap-snapshot https://ecomp-nexus:8443/repository/maven-snapshots/ false @@ -61,8 +61,8 @@ - openecomp-snapshot - openecomp-snapshot + onap-snapshot + onap-snapshot https://ecomp-nexus:8443/repository/maven-snapshots/ false @@ -137,8 +137,8 @@ - openecomp-release - openecomp-snapshots + onap-release + onap-snapshots opendaylight-release opendaylight-snapshots @@ -150,12 +150,12 @@ ${ecomp.nexus.password} - openecomp-release + onap-release ${ecomp.nexus.user} ${ecomp.nexus.password} - openecomp-snapshot + onap-snapshot ${ecomp.nexus.user} ${ecomp.nexus.password} diff --git a/pom.xml b/pom.xml index 96436f7ef..215f173fd 100755 --- a/pom.xml +++ b/pom.xml @@ -14,33 +14,33 @@ sdnc-plugins SDN-C Java Plugins - https://wiki.openecomp.org + https://wiki.onap.org The SDN-C core components contains the SLI, dblib and root pom JIRA - https://jira.openecomp.org/ + https://jira.onap.org/ - scm:git:ssh://git@${openecomp.git.host}/sdnc-plugins.git - scm:git:ssh://${openecomp.git.host}:${openecomp.git.port}/${openecomp.git.project}/sdnc-iplugins.git - ${openecomp.git.protocol}://${openecomp.git.host}/projects/${openecomp.git.project}/repos/sdnc-plugins/browse + scm:git:ssh://git@${onap.git.host}/ccsdk/sli/plugins.git + scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/ccsdk/sli/plugins.git + ${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/ccsdk/sli/plugins/browse HEAD Jenkins - https://jenkins.openecomp.org + https://jenkins.onap.org sdnc-javadoc - dav:https://${openecomp.nexus.host}/content/sites/site/org/onap/sdnc/plugins/${project.artifactId}/${project.version} + dav:https://${onap.nexus.host}/content/sites/site/org/onap/sdnc/plugins/${project.artifactId}/${project.version} @@ -97,9 +97,9 @@ 1.6.7 true - https://${openecomp.nexus.host} - ${openecomp.nexus.staging.profile-id} - ${openecomp.nexus.staging.server-id} + https://${onap.nexus.host} + ${onap.nexus.staging.profile-id} + ${onap.nexus.staging.server-id} diff --git a/properties-node/features/src/main/resources/features.xml b/properties-node/features/src/main/resources/features.xml index e89b333e9..2ed98a124 100644 --- a/properties-node/features/src/main/resources/features.xml +++ b/properties-node/features/src/main/resources/features.xml @@ -32,7 +32,7 @@ sdnc-sli spring spring-dm - mvn:org.openecomp.sdnc.plugins/properties-node-provider/${project.version} + mvn:org.onap.ccsdk.sli.plugins/properties-node-provider/${project.version} diff --git a/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java b/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java new file mode 100644 index 000000000..aa5663066 --- /dev/null +++ b/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.prop; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; +import java.util.Properties; + +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class PropertiesNode implements SvcLogicJavaPlugin { + + private static final Logger log = LoggerFactory.getLogger(PropertiesNode.class); + + public void readProperties(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + String fileName = parseParam(paramMap, "fileName", true, null); + String contextPrefix = parseParam(paramMap, "contextPrefix", false, null); + + try { + Properties pp = new Properties(); + InputStream in = new FileInputStream(fileName); + pp.load(in); + for (Object key : pp.keySet()) { + String pfx = contextPrefix != null ? contextPrefix + '.' : ""; + String name = (String) key; + String value = pp.getProperty(name); + if (value != null && value.trim().length() > 0) { + ctx.setAttribute(pfx + name, value.trim()); + log.info("+++ " + pfx + name + ": [" + value + "]"); + } + } + } catch (IOException e) { + throw new SvcLogicException("Cannot read property file: " + fileName + ": " + e.getMessage(), e); + } + } + + private String parseParam(Map paramMap, String name, boolean required, String def) + throws SvcLogicException { + String s = paramMap.get(name); + + if (s == null || s.trim().length() == 0) { + if (!required) + return def; + throw new SvcLogicException("Parameter " + name + " is required in PropertiesNode"); + } + + s = s.trim(); + String value = ""; + int i = 0; + int i1 = s.indexOf('%'); + while (i1 >= 0) { + int i2 = s.indexOf('%', i1 + 1); + if (i2 < 0) + throw new SvcLogicException("Cannot parse parameter " + name + ": " + s + ": no matching %"); + + String varName = s.substring(i1 + 1, i2); + String varValue = System.getenv(varName); + if (varValue == null) + varValue = ""; + + value += s.substring(i, i1); + value += varValue; + + i = i2 + 1; + i1 = s.indexOf('%', i); + } + value += s.substring(i); + + log.info("Parameter " + name + ": " + value); + return value; + } +} diff --git a/properties-node/provider/src/main/java/org/openecomp/sdnc/prop/PropertiesNode.java b/properties-node/provider/src/main/java/org/openecomp/sdnc/prop/PropertiesNode.java deleted file mode 100644 index 9856b1948..000000000 --- a/properties-node/provider/src/main/java/org/openecomp/sdnc/prop/PropertiesNode.java +++ /dev/null @@ -1,97 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.prop; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; -import java.util.Properties; - -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PropertiesNode implements SvcLogicJavaPlugin { - - private static final Logger log = LoggerFactory.getLogger(PropertiesNode.class); - - public void readProperties(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - String fileName = parseParam(paramMap, "fileName", true, null); - String contextPrefix = parseParam(paramMap, "contextPrefix", false, null); - - try { - Properties pp = new Properties(); - InputStream in = new FileInputStream(fileName); - pp.load(in); - for (Object key : pp.keySet()) { - String pfx = contextPrefix != null ? contextPrefix + '.' : ""; - String name = (String) key; - String value = pp.getProperty(name); - if (value != null && value.trim().length() > 0) { - ctx.setAttribute(pfx + name, value.trim()); - log.info("+++ " + pfx + name + ": [" + value + "]"); - } - } - } catch (IOException e) { - throw new SvcLogicException("Cannot read property file: " + fileName + ": " + e.getMessage(), e); - } - } - - private String parseParam(Map paramMap, String name, boolean required, String def) - throws SvcLogicException { - String s = paramMap.get(name); - - if (s == null || s.trim().length() == 0) { - if (!required) - return def; - throw new SvcLogicException("Parameter " + name + " is required in PropertiesNode"); - } - - s = s.trim(); - String value = ""; - int i = 0; - int i1 = s.indexOf('%'); - while (i1 >= 0) { - int i2 = s.indexOf('%', i1 + 1); - if (i2 < 0) - throw new SvcLogicException("Cannot parse parameter " + name + ": " + s + ": no matching %"); - - String varName = s.substring(i1 + 1, i2); - String varValue = System.getenv(varName); - if (varValue == null) - varValue = ""; - - value += s.substring(i, i1); - value += varValue; - - i = i2 + 1; - i1 = s.indexOf('%', i); - } - value += s.substring(i); - - log.info("Parameter " + name + ": " + value); - return value; - } -} diff --git a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml index a53ea1414..048acc4aa 100644 --- a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml +++ b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml @@ -26,7 +26,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml index 7d74fd4f0..ce17a4611 100644 --- a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml +++ b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml @@ -27,6 +27,6 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/restapi-call-node/features/src/main/resources/features.xml b/restapi-call-node/features/src/main/resources/features.xml index 648e6f78f..dbbe1b1c1 100644 --- a/restapi-call-node/features/src/main/resources/features.xml +++ b/restapi-call-node/features/src/main/resources/features.xml @@ -34,7 +34,7 @@ spring-dm mvn:com.sun.jersey/jersey-client/${jersey.version} mvn:org.codehaus.jettison/jettison/${jettison.version} - mvn:org.openecomp.sdnc.plugins/restapi-call-node-provider/${project.version} + mvn:org.onap.ccsdk.sli.plugins/restapi-call-node-provider/${project.version} diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index f864c2914..4b328d3d0 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -85,7 +85,7 @@ org.onap.ccsdk.sli.restapicall - org.openecomp.sdnc.restapicall + org.onap.ccsdk.sli.plugins.restapicall * diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java new file mode 100644 index 000000000..249378a06 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +public enum Format { + JSON, XML; + + public static Format fromString(String s) { + if (s == null) + return null; + if (s.equalsIgnoreCase("json")) + return JSON; + if (s.equalsIgnoreCase("xml")) + return XML; + throw new IllegalArgumentException("Invalid value for format: " + s); + } +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java new file mode 100644 index 000000000..e991a72b3 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +public enum HttpMethod { + GET, POST, PUT, DELETE, PATCH; + + public static HttpMethod fromString(String s) { + if (s == null) + return null; + if (s.equalsIgnoreCase("get")) + return GET; + if (s.equalsIgnoreCase("post")) + return POST; + if (s.equalsIgnoreCase("put")) + return PUT; + if (s.equalsIgnoreCase("delete")) + return DELETE; + if (s.equalsIgnoreCase("patch")) + return PATCH; + throw new IllegalArgumentException("Invalid value for HTTP Method: " + s); + } +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java new file mode 100644 index 000000000..9fe449c75 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import javax.ws.rs.core.MultivaluedMap; + +public class HttpResponse { + public int code; + public String message; + public String body; + public MultivaluedMap headers; +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java new file mode 100644 index 000000000..2a9716079 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.codehaus.jettison.json.JSONArray; +import org.codehaus.jettison.json.JSONException; +import org.codehaus.jettison.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class JsonParser { + + private static final Logger log = LoggerFactory.getLogger(JsonParser.class); + + @SuppressWarnings("unchecked") + public static Map convertToProperties(String s) throws JSONException { + JSONObject json = new JSONObject(s); + + Map wm = new HashMap(); + Iterator ii = json.keys(); + while (ii.hasNext()) { + String key1 = ii.next(); + wm.put(key1, json.get(key1)); + } + + Map mm = new HashMap(); + + while (!wm.isEmpty()) + for (String key : new ArrayList<>(wm.keySet())) { + Object o = wm.get(key); + wm.remove(key); + + if (o instanceof Boolean || o instanceof Number || o instanceof String) { + mm.put(key, o.toString()); + + log.info("Added property: " + key + ": " + o.toString()); + } + + else if (o instanceof JSONObject) { + JSONObject jo = (JSONObject) o; + Iterator i = jo.keys(); + while (i.hasNext()) { + String key1 = i.next(); + wm.put(key + "." + key1, jo.get(key1)); + } + } + + else if (o instanceof JSONArray) { + JSONArray ja = (JSONArray) o; + mm.put(key + "_length", String.valueOf(ja.length())); + + log.info("Added property: " + key + "_length" + ": " + String.valueOf(ja.length())); + + for (int i = 0; i < ja.length(); i++) + wm.put(key + '[' + i + ']', ja.get(i)); + } + } + + return mm; + } +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java new file mode 100644 index 000000000..8d1335cc5 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import java.util.Set; + +public class Parameters { + public String templateFileName; + public String restapiUrl; + public String restapiUser; + public String restapiPassword; + public Format format; + public String contentType; + public HttpMethod httpMethod; + public String responsePrefix; + public Set listNameList; + public boolean skipSending; + public boolean convertResponse; + public String keyStoreFileName; + public String keyStorePassword; + public String trustStoreFileName; + public String trustStorePassword; + public boolean ssl; + public String customHttpHeaders; + public String partner; + public Boolean dumpHeaders; +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java new file mode 100644 index 000000000..9de11fb0a --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -0,0 +1,759 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import java.io.FileInputStream; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.KeyStore; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.ws.rs.core.EntityTag; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.UriBuilder; + +import org.apache.commons.lang3.StringUtils; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; +import com.sun.jersey.client.urlconnection.HTTPSProperties; + +public class RestapiCallNode implements SvcLogicJavaPlugin { + + private static final Logger log = LoggerFactory.getLogger(RestapiCallNode.class); + + private String uebServers; + private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; + protected RetryPolicyStore retryPolicyStore; + + protected RetryPolicyStore getRetryPolicyStore() { + return retryPolicyStore; + } + + public void setRetryPolicyStore(RetryPolicyStore retryPolicyStore) { + this.retryPolicyStore = retryPolicyStore; + } + + public RestapiCallNode() { + + } + + /** + * Allows Directed Graphs the ability to interact with REST APIs. + * @param parameters HashMap of parameters passed by the DG to this function + * + * + * + * + * + * + * + * + * + * + * + * vpn-information.vrf-details + * + * + * + * + * + * + *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to template file that can be used to build a request/sdncopt/bvc/restapi/templates/vnf_service-configuration-operation_minimal.json
restapiUrlMandatoryurl to send the request tohttps://sdncodl:8543/restconf/operations/L3VNF-API:create-update-vnf-request
restapiUserOptionaluser name to use for http basic authenticationsdnc_ws
restapiPasswordOptionalunencrypted password to use for http basic authenticationplain_password
contentTypeOptionalhttp content type to set in the http headerusually application/json or application/xml
formatOptionalshould match request body formatjson or xml
httpMethodOptionalhttp method to use when sending the requestget post put delete patch
responsePrefixOptionallocation the response will be written to in context memorytmp.restapi.result
listName[i]OptionalUsed for processing XML responses with repeating elements.
skipSendingOptionaltrue or false
convertResponse Optionalwhether the response should be convertedtrue or false
customHttpHeadersOptionala list additional http headers to be passed in, follow the format in the exampleX-CSI-MessageId=messageId,headerFieldName=headerFieldValue
dumpHeadersOptionalwhen true writes http header content to context memorytrue or false
partnerOptionalneeded for DME2 callsdme2proxy
+ * @param ctx Reference to context memory + * @throws SvcLogicException + * @since 11.0.2 + * @see String#split(String, int) + */ + public void sendRequest(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + sendRequest(paramMap, ctx, null); + } + + public void sendRequest(Map paramMap, SvcLogicContext ctx, Integer retryCount) + throws SvcLogicException { + + RetryPolicy retryPolicy = null; + HttpResponse r = null; + try { + Parameters p = getParameters(paramMap); + if (p.partner != null) { + retryPolicy = retryPolicyStore.getRetryPolicy(p.partner); + } + String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; + + String req = null; + if (p.templateFileName != null) { + String reqTemplate = readFile(p.templateFileName); + req = buildXmlJsonRequest(ctx, reqTemplate, p.format); + } + r = sendHttpRequest(req, p); + setResponseStatus(ctx, p.responsePrefix, r); + + if (p.dumpHeaders && r.headers != null) { + for (Entry> a : r.headers.entrySet()) { + ctx.setAttribute(pp + "header." + a.getKey(), StringUtils.join(a.getValue(), ",")); + } + } + + if (r.body != null && r.body.trim().length() > 0) { + ctx.setAttribute(pp + "httpResponse", r.body); + + if (p.convertResponse) { + Map mm = null; + if (p.format == Format.XML) + mm = XmlParser.convertToProperties(r.body, p.listNameList); + else if (p.format == Format.JSON) + mm = JsonParser.convertToProperties(r.body); + + if (mm != null) + for (String key : mm.keySet()) + ctx.setAttribute(pp + key, mm.get(key)); + } + } + } catch (Exception e) { + boolean shouldRetry = false; + if (e.getCause() instanceof java.net.SocketException) { + shouldRetry = true; + } + + log.error("Error sending the request: " + e.getMessage(), e); + String prefix = parseParam(paramMap, "responsePrefix", false, null); + if (retryPolicy == null || shouldRetry == false) { + setFailureResponseStatus(ctx, prefix, e.getMessage(), r); + } else { + if (retryCount == null) { + retryCount = 0; + } + String retryMessage = retryCount + " attempts were made out of " + retryPolicy.getMaximumRetries() + + " maximum retries."; + log.debug(retryMessage); + try { + retryCount = retryCount + 1; + if (retryCount < retryPolicy.getMaximumRetries() + 1) { + URI uri = new URI(paramMap.get("restapiUrl")); + String hostname = uri.getHost(); + String retryString = retryPolicy.getNextHostName((uri.toString())); + URI uriTwo = new URI(retryString); + URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port(uriTwo.getPort()).scheme( + uriTwo.getScheme()).build(); + paramMap.put("restapiUrl", retryUri.toString()); + log.debug("URL was set to " + retryUri.toString()); + log.debug("Failed to communicate with host " + hostname + + ". Request will be re-attempted using the host " + retryString + "."); + log.debug("This is retry attempt " + retryCount + " out of " + retryPolicy.getMaximumRetries()); + sendRequest(paramMap, ctx, retryCount); + } else { + log.debug("Maximum retries reached, calling setFailureResponseStatus."); + setFailureResponseStatus(ctx, prefix, e.getMessage(), r); + } + } catch (Exception ex) { + log.error("Could not attempt retry.", ex); + String retryErrorMessage = + "Retry attempt has failed. No further retry shall be attempted, calling setFailureResponseStatus."; + setFailureResponseStatus(ctx, prefix, retryErrorMessage, r); + } + } + } + + if (r != null && r.code >= 300) + throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); + } + + protected Parameters getParameters(Map paramMap) throws SvcLogicException { + Parameters p = new Parameters(); + p.templateFileName = parseParam(paramMap, "templateFileName", false, null); + p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); + p.restapiUser = parseParam(paramMap, "restapiUser", false, null); + p.restapiPassword = parseParam(paramMap, "restapiPassword", false, null); + p.contentType = parseParam(paramMap, "contentType", false, null); + p.format = Format.fromString(parseParam(paramMap, "format", false, "json")); + p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); + p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + p.listNameList = getListNameList(paramMap); + String skipSendingStr = paramMap.get("skipSending"); + p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + p.convertResponse = Boolean.valueOf(parseParam(paramMap, "convertResponse", false, "true")); + p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", false, null); + p.trustStorePassword = parseParam(paramMap, "trustStorePassword", false, null); + p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", false, null); + p.keyStorePassword = parseParam(paramMap, "keyStorePassword", false, null); + p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null && p.keyStoreFileName != null && + p.keyStorePassword != null; + p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null); + p.partner = parseParam(paramMap, "partner", false, null); + p.dumpHeaders = Boolean.valueOf(parseParam(paramMap, "dumpHeaders", false, null)); + return p; + } + + protected Set getListNameList(Map paramMap) { + Set ll = new HashSet(); + for (String key : paramMap.keySet()) + if (key.startsWith("listName")) + ll.add(paramMap.get(key)); + return ll; + } + + protected String parseParam(Map paramMap, String name, boolean required, String def) + throws SvcLogicException { + String s = paramMap.get(name); + + if (s == null || s.trim().length() == 0) { + if (!required) + return def; + throw new SvcLogicException("Parameter " + name + " is required in RestapiCallNode"); + } + + s = s.trim(); + String value = ""; + int i = 0; + int i1 = s.indexOf('%'); + while (i1 >= 0) { + int i2 = s.indexOf('%', i1 + 1); + if (i2 < 0) + break; + + String varName = s.substring(i1 + 1, i2); + String varValue = System.getenv(varName); + if (varValue == null) + varValue = "%" + varName + "%"; + + value += s.substring(i, i1); + value += varValue; + + i = i2 + 1; + i1 = s.indexOf('%', i); + } + value += s.substring(i); + + log.info("Parameter " + name + ": [" + value + "]"); + return value; + } + + protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) { + log.info("Building " + format + " started"); + long t1 = System.currentTimeMillis(); + + template = expandRepeats(ctx, template, 1); + + Map mm = new HashMap<>(); + for (String s : ctx.getAttributeKeySet()) + mm.put(s, ctx.getAttribute(s)); + + StringBuilder ss = new StringBuilder(); + int i = 0; + while (i < template.length()) { + int i1 = template.indexOf("${", i); + if (i1 < 0) { + ss.append(template.substring(i)); + break; + } + + int i2 = template.indexOf('}', i1 + 2); + if (i2 < 0) + throw new RuntimeException("Template error: Matching } not found"); + + String var1 = template.substring(i1 + 2, i2); + String value1 = format == Format.XML ? XmlJsonUtil.getXml(mm, var1) : XmlJsonUtil.getJson(mm, var1); + // log.info(" " + var1 + ": " + value1); + if (value1 == null || value1.trim().length() == 0) { + // delete the whole element (line) + int i3 = template.lastIndexOf('\n', i1); + if (i3 < 0) + i3 = 0; + int i4 = template.indexOf('\n', i1); + if (i4 < 0) + i4 = template.length(); + + if (i < i3) + ss.append(template.substring(i, i3)); + i = i4; + } else { + ss.append(template.substring(i, i1)).append(value1); + i = i2 + 1; + } + } + + String req = format == Format.XML + ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) : XmlJsonUtil.removeEmptyStructJson(ss.toString()); + + if (format == Format.JSON) + req = XmlJsonUtil.removeLastCommaJson(req); + + long t2 = System.currentTimeMillis(); + log.info("Building " + format + " completed. Time: " + (t2 - t1)); + + return req; + } + + protected String expandRepeats(SvcLogicContext ctx, String template, int level) { + StringBuilder newTemplate = new StringBuilder(); + int k = 0; + while (k < template.length()) { + int i1 = template.indexOf("${repeat:", k); + if (i1 < 0) { + newTemplate.append(template.substring(k)); + break; + } + + int i2 = template.indexOf(':', i1 + 9); + if (i2 < 0) + throw new RuntimeException( + "Template error: Context variable name followed by : is required after repeat"); + + // Find the closing }, store in i3 + int nn = 1; + int i3 = -1; + int i = i2; + while (nn > 0 && i < template.length()) { + i3 = template.indexOf('}', i); + if (i3 < 0) + throw new RuntimeException("Template error: Matching } not found"); + int i32 = template.indexOf('{', i); + if (i32 >= 0 && i32 < i3) { + nn++; + i = i32 + 1; + } else { + nn--; + i = i3 + 1; + } + } + + String var1 = template.substring(i1 + 9, i2); + String value1 = ctx.getAttribute(var1); + log.info(" " + var1 + ": " + value1); + int n = 0; + try { + n = Integer.parseInt(value1); + } catch (Exception e) { + n = 0; + } + + newTemplate.append(template.substring(k, i1)); + + String rpt = template.substring(i2 + 1, i3); + + for (int ii = 0; ii < n; ii++) { + String ss = rpt.replaceAll("\\[\\$\\{" + level + "\\}\\]", "[" + ii + "]"); + if (ii == n - 1 && ss.trim().endsWith(",")) { + int i4 = ss.lastIndexOf(','); + if (i4 > 0) + ss = ss.substring(0, i4) + ss.substring(i4 + 1); + } + newTemplate.append(ss); + } + + k = i3 + 1; + } + + if (k == 0) + return newTemplate.toString(); + + return expandRepeats(ctx, newTemplate.toString(), level + 1); + } + + protected String readFile(String fileName) throws Exception { + byte[] encoded = Files.readAllBytes(Paths.get(fileName)); + return new String(encoded, "UTF-8"); + } + + protected HttpResponse sendHttpRequest(String request, Parameters p) throws Exception { + ClientConfig config = new DefaultClientConfig(); + SSLContext ssl = null; + if (p.ssl && p.restapiUrl.startsWith("https")) + ssl = createSSLContext(p); + if (ssl != null) { + HostnameVerifier hostnameVerifier = new HostnameVerifier() { + + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + + config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, + new HTTPSProperties(hostnameVerifier, ssl)); + } + + logProperties(config.getProperties()); + + Client client = Client.create(config); + client.setConnectTimeout(5000); + if (p.restapiUser != null) + client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); + WebResource webResource = client.resource(p.restapiUrl); + + log.info("Sending request:"); + log.info(request); + long t1 = System.currentTimeMillis(); + + HttpResponse r = new HttpResponse(); + r.code = 200; + + if (!p.skipSending) { + String tt = p.format == Format.XML ? "application/xml" : "application/json"; + String tt1 = tt + ";charset=UTF-8"; + if (p.contentType != null) { + tt = p.contentType; + tt1 = p.contentType; + } + + WebResource.Builder webResourceBuilder = webResource.accept(tt).type(tt1); + + if (p.customHttpHeaders != null && p.customHttpHeaders.length() > 0) { + String[] keyValuePairs = p.customHttpHeaders.split(","); + for (String singlePair : keyValuePairs) { + int equalPosition = singlePair.indexOf('='); + webResourceBuilder.header(singlePair.substring(0, equalPosition), singlePair.substring(equalPosition + 1, singlePair.length())); + } + } + + webResourceBuilder.header("X-ECOMP-RequestID",org.slf4j.MDC.get("X-ECOMP-RequestID")); + + ClientResponse response = webResourceBuilder.method(p.httpMethod.toString(), ClientResponse.class, request); + + r.code = response.getStatus(); + r.headers = response.getHeaders(); + EntityTag etag = response.getEntityTag(); + if (etag != null) + r.message = etag.getValue(); + if (response.hasEntity() && r.code != 204) + r.body = response.getEntity(String.class); + } + + long t2 = System.currentTimeMillis(); + log.info("Response received. Time: " + (t2 - t1)); + log.info("HTTP response code: " + r.code); + log.info("HTTP response message: " + r.message); + logHeaders(r.headers); + log.info("HTTP response: " + r.body); + + return r; + } + + protected SSLContext createSSLContext(Parameters p) { + try { + System.setProperty("jsse.enableSNIExtension", "false"); + System.setProperty("javax.net.ssl.trustStore", p.trustStoreFileName); + System.setProperty("javax.net.ssl.trustStorePassword", p.trustStorePassword); + + HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { + + @Override + public boolean verify(String string, SSLSession ssls) { + return true; + } + }); + + KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + FileInputStream in = new FileInputStream(p.keyStoreFileName); + KeyStore ks = KeyStore.getInstance("PKCS12"); + char[] pwd = p.keyStorePassword.toCharArray(); + ks.load(in, pwd); + kmf.init(ks, pwd); + + SSLContext ctx = SSLContext.getInstance("TLS"); + ctx.init(kmf.getKeyManagers(), null, null); + return ctx; + } catch (Exception e) { + log.error("Error creating SSLContext: " + e.getMessage(), e); + } + return null; + } + + protected void setFailureResponseStatus(SvcLogicContext ctx, String prefix, String errorMessage, HttpResponse r) { + r = new HttpResponse(); + r.code = 500; + r.message = errorMessage; + String pp = prefix != null ? prefix + '.' : ""; + ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); + ctx.setAttribute(pp + "response-message", r.message); + } + + protected void setResponseStatus(SvcLogicContext ctx, String prefix, HttpResponse r) { + String pp = prefix != null ? prefix + '.' : ""; + ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); + ctx.setAttribute(pp + "response-message", r.message); + } + + public void sendFile(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + HttpResponse r = null; + try { + FileParam p = getFileParameters(paramMap); + byte[] data = Files.readAllBytes(Paths.get(p.fileName)); + + r = sendHttpData(data, p); + setResponseStatus(ctx, p.responsePrefix, r); + + } catch (Exception e) { + log.error("Error sending the request: " + e.getMessage(), e); + + r = new HttpResponse(); + r.code = 500; + r.message = e.getMessage(); + String prefix = parseParam(paramMap, "responsePrefix", false, null); + setResponseStatus(ctx, prefix, r); + } + + if (r != null && r.code >= 300) + throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); + } + + private static class FileParam { + + public String fileName; + public String url; + public String user; + public String password; + public HttpMethod httpMethod; + public String responsePrefix; + public boolean skipSending; + } + + private FileParam getFileParameters(Map paramMap) throws SvcLogicException { + FileParam p = new FileParam(); + p.fileName = parseParam(paramMap, "fileName", true, null); + p.url = parseParam(paramMap, "url", true, null); + p.user = parseParam(paramMap, "user", false, null); + p.password = parseParam(paramMap, "password", false, null); + p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); + p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + String skipSendingStr = paramMap.get("skipSending"); + p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + return p; + } + + protected HttpResponse sendHttpData(byte[] data, FileParam p) { + Client client = Client.create(); + client.setConnectTimeout(5000); + client.setFollowRedirects(true); + if (p.user != null) + client.addFilter(new HTTPBasicAuthFilter(p.user, p.password)); + WebResource webResource = client.resource(p.url); + + log.info("Sending file"); + long t1 = System.currentTimeMillis(); + + HttpResponse r = new HttpResponse(); + r.code = 200; + + if (!p.skipSending) { + String tt = "application/octet-stream"; + + ClientResponse response = null; + if (p.httpMethod == HttpMethod.POST) + response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); + else if (p.httpMethod == HttpMethod.PUT) + response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); + + r.code = response.getStatus(); + r.headers = response.getHeaders(); + EntityTag etag = response.getEntityTag(); + if (etag != null) + r.message = etag.getValue(); + if (response.hasEntity() && r.code != 204) + r.body = response.getEntity(String.class); + + if (r.code == 301) { + String newUrl = response.getHeaders().getFirst("Location"); + + log.info("Got response code 301. Sending same request to URL: " + newUrl); + + webResource = client.resource(newUrl); + + if (p.httpMethod == HttpMethod.POST) + response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); + else if (p.httpMethod == HttpMethod.PUT) + response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); + + r.code = response.getStatus(); + etag = response.getEntityTag(); + if (etag != null) + r.message = etag.getValue(); + if (response.hasEntity() && r.code != 204) + r.body = response.getEntity(String.class); + } + } + + long t2 = System.currentTimeMillis(); + log.info("Response received. Time: " + (t2 - t1)); + log.info("HTTP response code: " + r.code); + log.info("HTTP response message: " + r.message); + logHeaders(r.headers); + log.info("HTTP response: " + r.body); + + return r; + } + + public void postMessageOnUeb(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + HttpResponse r = null; + try { + UebParam p = getUebParameters(paramMap); + + String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; + + String req = null; + + if (p.templateFileName == null) { + log.info("No template file name specified. Using default UEB template: " + defaultUebTemplateFileName); + p.templateFileName = defaultUebTemplateFileName; + } + + String reqTemplate = readFile(p.templateFileName); + reqTemplate = reqTemplate.replaceAll("rootVarName", p.rootVarName); + req = buildXmlJsonRequest(ctx, reqTemplate, Format.JSON); + + r = postOnUeb(req, p); + setResponseStatus(ctx, p.responsePrefix, r); + if (r.body != null) + ctx.setAttribute(pp + "httpResponse", r.body); + + } catch (Exception e) { + log.error("Error sending the request: " + e.getMessage(), e); + + r = new HttpResponse(); + r.code = 500; + r.message = e.getMessage(); + String prefix = parseParam(paramMap, "responsePrefix", false, null); + setResponseStatus(ctx, prefix, r); + } + + if (r != null && r.code >= 300) + throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); + } + + private static class UebParam { + + public String topic; + public String templateFileName; + public String rootVarName; + public String responsePrefix; + public boolean skipSending; + } + + private UebParam getUebParameters(Map paramMap) throws SvcLogicException { + UebParam p = new UebParam(); + p.topic = parseParam(paramMap, "topic", true, null); + p.templateFileName = parseParam(paramMap, "templateFileName", false, null); + p.rootVarName = parseParam(paramMap, "rootVarName", false, null); + p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + String skipSendingStr = paramMap.get("skipSending"); + p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + return p; + } + + protected HttpResponse postOnUeb(String request, UebParam p) throws Exception { + String[] urls = uebServers.split(" "); + for (int i = 0; i < urls.length; i++) { + if (!urls[i].endsWith("/")) + urls[i] += "/"; + urls[i] += "events/" + p.topic; + } + + Client client = Client.create(); + client.setConnectTimeout(5000); + WebResource webResource = client.resource(urls[0]); + + log.info("UEB URL: " + urls[0]); + log.info("Sending request:"); + log.info(request); + long t1 = System.currentTimeMillis(); + + HttpResponse r = new HttpResponse(); + r.code = 200; + + if (!p.skipSending) { + String tt = "application/json"; + String tt1 = tt + ";charset=UTF-8"; + + ClientResponse response = webResource.accept(tt).type(tt1).post(ClientResponse.class, request); + + r.code = response.getStatus(); + r.headers = response.getHeaders(); + if (response.hasEntity()) + r.body = response.getEntity(String.class); + } + + long t2 = System.currentTimeMillis(); + log.info("Response received. Time: " + (t2 - t1)); + log.info("HTTP response code: " + r.code); + logHeaders(r.headers); + log.info("HTTP response:\n" + r.body); + + return r; + } + + protected void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + String.valueOf(mm.get(name))); + } + + protected void logHeaders(MultivaluedMap mm) { + log.info("HTTP response headers:"); + + if (mm == null) + return; + + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + for (String name : ll) + log.info("--- " + name + ": " + String.valueOf(mm.get(name))); + } + + public void setUebServers(String uebServers) { + this.uebServers = uebServers; + } + + public void setDefaultUebTemplateFileName(String defaultUebTemplateFileName) { + this.defaultUebTemplateFileName = defaultUebTemplateFileName; + } +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryException.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryException.java new file mode 100644 index 000000000..2a8002819 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryException.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +public class RetryException extends Exception { + + public RetryException(String message) { + super(message); + } + +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java new file mode 100644 index 000000000..3059a4457 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +public class RetryPolicy { + private String[] hostnames; + private Integer maximumRetries; + + public Integer getMaximumRetries() { + return maximumRetries; + } + + public String getNextHostName(String uri) throws RetryException { + Integer position = null; + + for (int i = 0; i < hostnames.length; i++) { + if (uri.contains(hostnames[i])) { + position = i; + break; + } + } + + if(position == null){ + throw new RetryException("No match found for the provided uri[" + uri + "] so the next host name could not be retreived"); + } + position++; + + if (position > hostnames.length - 1) { + position = 0; + } + return hostnames[position]; + } + + public RetryPolicy(String[] hostnames, Integer maximumRetries){ + this.hostnames = hostnames; + this.maximumRetries = maximumRetries; + } + + +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java new file mode 100644 index 000000000..18ec2fb76 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import java.util.HashMap; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RetryPolicyStore { + private static final Logger log = LoggerFactory.getLogger(RetryPolicyStore.class); + + HashMap retryPolicies; + public String proxyServers; + + public String getProxyServers() { + return proxyServers; + } + + public void setProxyServers(String admServers) { + this.proxyServers = admServers; + String[] adminServersArray = admServers.split(","); + RetryPolicy adminPortalRetry = new RetryPolicy(adminServersArray, adminServersArray.length); + retryPolicies.put("dme2proxy", adminPortalRetry); + } + + public RetryPolicyStore() { + retryPolicies = new HashMap(); + } + + public RetryPolicy getRetryPolicy(String policyName) { + return (this.retryPolicies.get(policyName)); + } + +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java new file mode 100644 index 000000000..5131c8745 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -0,0 +1,372 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class XmlJsonUtil { + + private static final Logger log = LoggerFactory.getLogger(XmlJsonUtil.class); + + public static String getXml(Map varmap, String var) { + boolean escape = true; + if (var.startsWith("'")) { + var = var.substring(1); + escape = false; + } + + Object o = createStructure(varmap, var); + return generateXml(o, 0, escape); + } + + public static String getJson(Map varmap, String var) { + boolean escape = true; + if (var.startsWith("'")) { + var = var.substring(1); + escape = false; + } + + Object o = createStructure(varmap, var); + return generateJson(o, escape); + } + + private static Object createStructure(Map flatmap, String var) { + if (flatmap.containsKey(var)) { + if (var.endsWith("_length") || var.endsWith("].key")) + return null; + return flatmap.get(var); + } + + Map mm = new HashMap<>(); + for (String k : flatmap.keySet()) + if (k.startsWith(var + ".")) { + int i1 = k.indexOf('.', var.length() + 1); + int i2 = k.indexOf('[', var.length() + 1); + int i3 = k.length(); + if (i1 > 0 && i1 < i3) + i3 = i1; + if (i2 > 0 && i2 < i3) + i3 = i2; + String k1 = k.substring(var.length() + 1, i3); + String var1 = k.substring(0, i3); + if (!mm.containsKey(k1)) { + Object str = createStructure(flatmap, var1); + if (str != null && (!(str instanceof String) || ((String) str).trim().length() > 0)) + mm.put(k1, str); + } + } + if (!mm.isEmpty()) + return mm; + + boolean arrayFound = false; + for (String k : flatmap.keySet()) + if (k.startsWith(var + "[")) { + arrayFound = true; + break; + } + + if (arrayFound) { + List ll = new ArrayList<>(); + + int length = Integer.MAX_VALUE; + String lengthStr = flatmap.get(var + "_length"); + if (lengthStr != null) { + try { + length = Integer.parseInt(lengthStr); + } catch (Exception e) { + log.warn("Invalid number for " + var + "_length:" + lengthStr); + } + } + + for (int i = 0; i < length; i++) { + Object v = createStructure(flatmap, var + '[' + i + ']'); + if (v == null) + break; + ll.add(v); + } + + if (!ll.isEmpty()) + return ll; + } + + return null; + } + + @SuppressWarnings("unchecked") + private static String generateXml(Object o, int indent, boolean escape) { + if (o == null) + return null; + + if (o instanceof String) + return escape ? escapeXml((String) o) : (String) o;; + + if (o instanceof Map) { + StringBuilder ss = new StringBuilder(); + Map mm = (Map) o; + for (String k : mm.keySet()) { + Object v = mm.get(k); + if (v instanceof String) { + String s = escape ? escapeXml((String) v) : (String) v; + ss.append(pad(indent)).append('<').append(k).append('>'); + ss.append(s); + ss.append("').append('\n'); + } else if (v instanceof Map) { + ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); + ss.append(generateXml(v, indent + 1, escape)); + ss.append(pad(indent)).append("').append('\n'); + } else if (v instanceof List) { + List ll = (List) v; + for (Object o1 : ll) { + ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); + ss.append(generateXml(o1, indent + 1, escape)); + ss.append(pad(indent)).append("').append('\n'); + } + } + } + return ss.toString(); + } + + return null; + } + + private static String generateJson(Object o, boolean escape) { + if (o == null) + return null; + + StringBuilder ss = new StringBuilder(); + generateJson(ss, o, 0, false, escape); + return ss.toString(); + } + + @SuppressWarnings("unchecked") + private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape) { + if (o instanceof String) { + String s = escape ? escapeJson((String) o) : (String) o; + if (padFirst) + ss.append(pad(indent)); + ss.append('"').append(s).append('"'); + return; + } + + if (o instanceof Map) { + Map mm = (Map) o; + + if (padFirst) + ss.append(pad(indent)); + ss.append("{\n"); + + boolean first = true; + for (String k : mm.keySet()) { + if (!first) + ss.append(",\n"); + first = false; + + Object v = mm.get(k); + ss.append(pad(indent + 1)).append('"').append(k).append("\": "); + generateJson(ss, v, indent + 1, false, escape); + } + + ss.append("\n"); + ss.append(pad(indent)).append('}'); + + return; + } + + if (o instanceof List) { + List ll = (List) o; + + if (padFirst) + ss.append(pad(indent)); + ss.append("[\n"); + + boolean first = true; + for (Object o1 : ll) { + if (!first) + ss.append(",\n"); + first = false; + + generateJson(ss, o1, indent + 1, true, escape); + } + + ss.append("\n"); + ss.append(pad(indent)).append(']'); + } + } + + public static String removeLastCommaJson(String s) { + StringBuilder sb = new StringBuilder(); + int k = 0; + int start = 0; + while (k < s.length()) { + int i11 = s.indexOf('}', k); + int i12 = s.indexOf(']', k); + int i1 = -1; + if (i11 < 0) + i1 = i12; + else if (i12 < 0) + i1 = i11; + else + i1 = i11 < i12 ? i11 : i12; + if (i1 < 0) + break; + + int i2 = s.lastIndexOf(',', i1); + if (i2 < 0) { + k = i1 + 1; + continue; + } + + String between = s.substring(i2 + 1, i1); + if (between.trim().length() > 0) { + k = i1 + 1; + continue; + } + + sb.append(s.substring(start, i2)); + start = i2 + 1; + k = i1 + 1; + } + + sb.append(s.substring(start, s.length())); + + return sb.toString(); + } + + public static String removeEmptyStructJson(String s) { + int k = 0; + while (k < s.length()) { + boolean curly = true; + int i11 = s.indexOf('{', k); + int i12 = s.indexOf('[', k); + int i1 = -1; + if (i11 < 0) { + i1 = i12; + curly = false; + } else if (i12 < 0) + i1 = i11; + else + if (i11 < i12) + i1 = i11; + else { + i1 = i12; + curly = false; + } + + if (i1 >= 0) { + int i2 = curly ? s.indexOf('}', i1) : s.indexOf(']', i1); + if (i2 > 0) { + String value = s.substring(i1 + 1, i2); + if (value.trim().length() == 0) { + int i4 = s.lastIndexOf('\n', i1); + if (i4 < 0) + i4 = 0; + int i5 = s.indexOf('\n', i2); + if (i5 < 0) + i5 = s.length(); + + s = s.substring(0, i4) + s.substring(i5); + k = 0; + } else + k = i1 + 1; + } else + break; + } else + break; + } + + return s; + } + + public static String removeEmptyStructXml(String s) { + int k = 0; + while (k < s.length()) { + int i1 = s.indexOf('<', k); + if (i1 < 0 || i1 == s.length() - 1) + break; + + char c1 = s.charAt(i1 + 1); + if (c1 == '?' || c1 == '!') { + k = i1 + 2; + continue; + } + + int i2 = s.indexOf('>', i1); + if (i2 < 0) { + k = i1 + 1; + continue; + } + + String closingTag = " 0) { + k = i2 + 1; + continue; + } + + int i4 = s.lastIndexOf('\n', i1); + if (i4 < 0) + i4 = 0; + int i5 = s.indexOf('\n', i3); + if (i5 < 0) + i5 = s.length(); + + s = s.substring(0, i4) + s.substring(i5); + k = 0; + } + + return s; + } + + private static String escapeXml(String v) { + String s = v.replaceAll("&", "&"); + s = s.replaceAll("<", "<"); + s = s.replaceAll("'", "'"); + s = s.replaceAll("\"", """); + s = s.replaceAll(">", ">"); + return s; + } + + private static String escapeJson(String v) { + String s = v.replaceAll("\\\\", "\\\\\\\\"); + s = s.replaceAll("\"", "\\\\\""); + return s; + } + + private static String pad(int n) { + String s = ""; + for (int i = 0; i < n; i++) + s += '\t'; + return s; + } +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java new file mode 100644 index 000000000..7a3243762 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java @@ -0,0 +1,160 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public class XmlParser { + + private static final Logger log = LoggerFactory.getLogger(XmlParser.class); + + public static Map convertToProperties(String s, Set listNameList) { + Handler handler = new Handler(listNameList); + try { + SAXParserFactory factory = SAXParserFactory.newInstance(); + SAXParser saxParser = factory.newSAXParser(); + InputStream in = new ByteArrayInputStream(s.getBytes()); + saxParser.parse(in, handler); + } catch (Exception e) { + e.printStackTrace(); + } + + return handler.getProperties(); + } + + private static class Handler extends DefaultHandler { + + private Set listNameList; + + private Map properties = new HashMap<>(); + + public Map getProperties() { + return properties; + } + + public Handler(Set listNameList) { + super(); + this.listNameList = listNameList; + if (this.listNameList == null) + this.listNameList = new HashSet(); + } + + String currentName = ""; + String currentValue = ""; + + @Override + public void startElement(String uri, String localName, String qName, Attributes attributes) + throws SAXException { + super.startElement(uri, localName, qName, attributes); + + String name = localName; + if (name == null || name.trim().length() == 0) + name = qName; + int i2 = name.indexOf(':'); + if (i2 >= 0) + name = name.substring(i2 + 1); + + if (currentName.length() > 0) + currentName += '.'; + currentName += name; + + String listName = removeIndexes(currentName); + + if (listNameList.contains(listName)) { + int len = getInt(properties, currentName + "_length"); + properties.put(currentName + "_length", String.valueOf(len + 1)); + currentName += "[" + len + "]"; + } + } + + @Override + public void endElement(String uri, String localName, String qName) throws SAXException { + super.endElement(uri, localName, qName); + + String name = localName; + if (name == null || name.trim().length() == 0) + name = qName; + int i2 = name.indexOf(':'); + if (i2 >= 0) + name = name.substring(i2 + 1); + + if (currentValue.trim().length() > 0) { + currentValue = currentValue.trim(); + properties.put(currentName, currentValue); + + log.info("Added property: " + currentName + ": " + currentValue); + + currentValue = ""; + } + + int i1 = currentName.lastIndexOf("." + name); + if (i1 <= 0) + currentName = ""; + else + currentName = currentName.substring(0, i1); + } + + @Override + public void characters(char[] ch, int start, int length) throws SAXException { + super.characters(ch, start, length); + + String value = new String(ch, start, length); + currentValue += value; + } + + private static int getInt(Map mm, String name) { + String s = mm.get(name); + if (s == null) + return 0; + return Integer.parseInt(s); + } + + private String removeIndexes(String currentName) { + String s = ""; + boolean add = true; + for (int i = 0; i < currentName.length(); i++) { + char c = currentName.charAt(i); + if (c == '[') + add = false; + else if (c == ']') + add = true; + else if (add) + s += c; + } + return s; + } + } +} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java deleted file mode 100644 index 52086255f..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -public enum Format { - JSON, XML; - - public static Format fromString(String s) { - if (s == null) - return null; - if (s.equalsIgnoreCase("json")) - return JSON; - if (s.equalsIgnoreCase("xml")) - return XML; - throw new IllegalArgumentException("Invalid value for format: " + s); - } -} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpMethod.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpMethod.java deleted file mode 100644 index 059074bf9..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpMethod.java +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -public enum HttpMethod { - GET, POST, PUT, DELETE, PATCH; - - public static HttpMethod fromString(String s) { - if (s == null) - return null; - if (s.equalsIgnoreCase("get")) - return GET; - if (s.equalsIgnoreCase("post")) - return POST; - if (s.equalsIgnoreCase("put")) - return PUT; - if (s.equalsIgnoreCase("delete")) - return DELETE; - if (s.equalsIgnoreCase("patch")) - return PATCH; - throw new IllegalArgumentException("Invalid value for HTTP Method: " + s); - } -} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpResponse.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpResponse.java deleted file mode 100644 index 761e4264e..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpResponse.java +++ /dev/null @@ -1,31 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -import javax.ws.rs.core.MultivaluedMap; - -public class HttpResponse { - public int code; - public String message; - public String body; - public MultivaluedMap headers; -} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/JsonParser.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/JsonParser.java deleted file mode 100644 index 27e9a82ef..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/JsonParser.java +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.codehaus.jettison.json.JSONArray; -import org.codehaus.jettison.json.JSONException; -import org.codehaus.jettison.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class JsonParser { - - private static final Logger log = LoggerFactory.getLogger(JsonParser.class); - - @SuppressWarnings("unchecked") - public static Map convertToProperties(String s) throws JSONException { - JSONObject json = new JSONObject(s); - - Map wm = new HashMap(); - Iterator ii = json.keys(); - while (ii.hasNext()) { - String key1 = ii.next(); - wm.put(key1, json.get(key1)); - } - - Map mm = new HashMap(); - - while (!wm.isEmpty()) - for (String key : new ArrayList<>(wm.keySet())) { - Object o = wm.get(key); - wm.remove(key); - - if (o instanceof Boolean || o instanceof Number || o instanceof String) { - mm.put(key, o.toString()); - - log.info("Added property: " + key + ": " + o.toString()); - } - - else if (o instanceof JSONObject) { - JSONObject jo = (JSONObject) o; - Iterator i = jo.keys(); - while (i.hasNext()) { - String key1 = i.next(); - wm.put(key + "." + key1, jo.get(key1)); - } - } - - else if (o instanceof JSONArray) { - JSONArray ja = (JSONArray) o; - mm.put(key + "_length", String.valueOf(ja.length())); - - log.info("Added property: " + key + "_length" + ": " + String.valueOf(ja.length())); - - for (int i = 0; i < ja.length(); i++) - wm.put(key + '[' + i + ']', ja.get(i)); - } - } - - return mm; - } -} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Parameters.java deleted file mode 100644 index 0cba4e6b1..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Parameters.java +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -import java.util.Set; - -public class Parameters { - public String templateFileName; - public String restapiUrl; - public String restapiUser; - public String restapiPassword; - public Format format; - public String contentType; - public HttpMethod httpMethod; - public String responsePrefix; - public Set listNameList; - public boolean skipSending; - public boolean convertResponse; - public String keyStoreFileName; - public String keyStorePassword; - public String trustStoreFileName; - public String trustStorePassword; - public boolean ssl; - public String customHttpHeaders; - public String partner; - public Boolean dumpHeaders; -} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RestapiCallNode.java deleted file mode 100644 index b7598480c..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RestapiCallNode.java +++ /dev/null @@ -1,759 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -import java.io.FileInputStream; -import java.net.URI; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.KeyStore; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; -import javax.ws.rs.core.EntityTag; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.UriBuilder; - -import org.apache.commons.lang3.StringUtils; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.WebResource; -import com.sun.jersey.api.client.config.ClientConfig; -import com.sun.jersey.api.client.config.DefaultClientConfig; -import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; -import com.sun.jersey.client.urlconnection.HTTPSProperties; - -public class RestapiCallNode implements SvcLogicJavaPlugin { - - private static final Logger log = LoggerFactory.getLogger(RestapiCallNode.class); - - private String uebServers; - private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; - protected RetryPolicyStore retryPolicyStore; - - protected RetryPolicyStore getRetryPolicyStore() { - return retryPolicyStore; - } - - public void setRetryPolicyStore(RetryPolicyStore retryPolicyStore) { - this.retryPolicyStore = retryPolicyStore; - } - - public RestapiCallNode() { - - } - - /** - * Allows Directed Graphs the ability to interact with REST APIs. - * @param parameters HashMap of parameters passed by the DG to this function - * - * - * - * - * - * - * - * - * - * - * - * vpn-information.vrf-details - * - * - * - * - * - * - *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to template file that can be used to build a request/sdncopt/bvc/restapi/templates/vnf_service-configuration-operation_minimal.json
restapiUrlMandatoryurl to send the request tohttps://sdncodl:8543/restconf/operations/L3VNF-API:create-update-vnf-request
restapiUserOptionaluser name to use for http basic authenticationsdnc_ws
restapiPasswordOptionalunencrypted password to use for http basic authenticationplain_password
contentTypeOptionalhttp content type to set in the http headerusually application/json or application/xml
formatOptionalshould match request body formatjson or xml
httpMethodOptionalhttp method to use when sending the requestget post put delete patch
responsePrefixOptionallocation the response will be written to in context memorytmp.restapi.result
listName[i]OptionalUsed for processing XML responses with repeating elements.
skipSendingOptionaltrue or false
convertResponse Optionalwhether the response should be convertedtrue or false
customHttpHeadersOptionala list additional http headers to be passed in, follow the format in the exampleX-CSI-MessageId=messageId,headerFieldName=headerFieldValue
dumpHeadersOptionalwhen true writes http header content to context memorytrue or false
partnerOptionalneeded for DME2 callsdme2proxy
- * @param ctx Reference to context memory - * @throws SvcLogicException - * @since 11.0.2 - * @see String#split(String, int) - */ - public void sendRequest(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - sendRequest(paramMap, ctx, null); - } - - public void sendRequest(Map paramMap, SvcLogicContext ctx, Integer retryCount) - throws SvcLogicException { - - RetryPolicy retryPolicy = null; - HttpResponse r = null; - try { - Parameters p = getParameters(paramMap); - if (p.partner != null) { - retryPolicy = retryPolicyStore.getRetryPolicy(p.partner); - } - String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; - - String req = null; - if (p.templateFileName != null) { - String reqTemplate = readFile(p.templateFileName); - req = buildXmlJsonRequest(ctx, reqTemplate, p.format); - } - r = sendHttpRequest(req, p); - setResponseStatus(ctx, p.responsePrefix, r); - - if (p.dumpHeaders && r.headers != null) { - for (Entry> a : r.headers.entrySet()) { - ctx.setAttribute(pp + "header." + a.getKey(), StringUtils.join(a.getValue(), ",")); - } - } - - if (r.body != null && r.body.trim().length() > 0) { - ctx.setAttribute(pp + "httpResponse", r.body); - - if (p.convertResponse) { - Map mm = null; - if (p.format == Format.XML) - mm = XmlParser.convertToProperties(r.body, p.listNameList); - else if (p.format == Format.JSON) - mm = JsonParser.convertToProperties(r.body); - - if (mm != null) - for (String key : mm.keySet()) - ctx.setAttribute(pp + key, mm.get(key)); - } - } - } catch (Exception e) { - boolean shouldRetry = false; - if (e.getCause() instanceof java.net.SocketException) { - shouldRetry = true; - } - - log.error("Error sending the request: " + e.getMessage(), e); - String prefix = parseParam(paramMap, "responsePrefix", false, null); - if (retryPolicy == null || shouldRetry == false) { - setFailureResponseStatus(ctx, prefix, e.getMessage(), r); - } else { - if (retryCount == null) { - retryCount = 0; - } - String retryMessage = retryCount + " attempts were made out of " + retryPolicy.getMaximumRetries() + - " maximum retries."; - log.debug(retryMessage); - try { - retryCount = retryCount + 1; - if (retryCount < retryPolicy.getMaximumRetries() + 1) { - URI uri = new URI(paramMap.get("restapiUrl")); - String hostname = uri.getHost(); - String retryString = retryPolicy.getNextHostName((uri.toString())); - URI uriTwo = new URI(retryString); - URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port(uriTwo.getPort()).scheme( - uriTwo.getScheme()).build(); - paramMap.put("restapiUrl", retryUri.toString()); - log.debug("URL was set to " + retryUri.toString()); - log.debug("Failed to communicate with host " + hostname + - ". Request will be re-attempted using the host " + retryString + "."); - log.debug("This is retry attempt " + retryCount + " out of " + retryPolicy.getMaximumRetries()); - sendRequest(paramMap, ctx, retryCount); - } else { - log.debug("Maximum retries reached, calling setFailureResponseStatus."); - setFailureResponseStatus(ctx, prefix, e.getMessage(), r); - } - } catch (Exception ex) { - log.error("Could not attempt retry.", ex); - String retryErrorMessage = - "Retry attempt has failed. No further retry shall be attempted, calling setFailureResponseStatus."; - setFailureResponseStatus(ctx, prefix, retryErrorMessage, r); - } - } - } - - if (r != null && r.code >= 300) - throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); - } - - protected Parameters getParameters(Map paramMap) throws SvcLogicException { - Parameters p = new Parameters(); - p.templateFileName = parseParam(paramMap, "templateFileName", false, null); - p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); - p.restapiUser = parseParam(paramMap, "restapiUser", false, null); - p.restapiPassword = parseParam(paramMap, "restapiPassword", false, null); - p.contentType = parseParam(paramMap, "contentType", false, null); - p.format = Format.fromString(parseParam(paramMap, "format", false, "json")); - p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); - p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); - p.listNameList = getListNameList(paramMap); - String skipSendingStr = paramMap.get("skipSending"); - p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); - p.convertResponse = Boolean.valueOf(parseParam(paramMap, "convertResponse", false, "true")); - p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", false, null); - p.trustStorePassword = parseParam(paramMap, "trustStorePassword", false, null); - p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", false, null); - p.keyStorePassword = parseParam(paramMap, "keyStorePassword", false, null); - p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null && p.keyStoreFileName != null && - p.keyStorePassword != null; - p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null); - p.partner = parseParam(paramMap, "partner", false, null); - p.dumpHeaders = Boolean.valueOf(parseParam(paramMap, "dumpHeaders", false, null)); - return p; - } - - protected Set getListNameList(Map paramMap) { - Set ll = new HashSet(); - for (String key : paramMap.keySet()) - if (key.startsWith("listName")) - ll.add(paramMap.get(key)); - return ll; - } - - protected String parseParam(Map paramMap, String name, boolean required, String def) - throws SvcLogicException { - String s = paramMap.get(name); - - if (s == null || s.trim().length() == 0) { - if (!required) - return def; - throw new SvcLogicException("Parameter " + name + " is required in RestapiCallNode"); - } - - s = s.trim(); - String value = ""; - int i = 0; - int i1 = s.indexOf('%'); - while (i1 >= 0) { - int i2 = s.indexOf('%', i1 + 1); - if (i2 < 0) - break; - - String varName = s.substring(i1 + 1, i2); - String varValue = System.getenv(varName); - if (varValue == null) - varValue = "%" + varName + "%"; - - value += s.substring(i, i1); - value += varValue; - - i = i2 + 1; - i1 = s.indexOf('%', i); - } - value += s.substring(i); - - log.info("Parameter " + name + ": [" + value + "]"); - return value; - } - - protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) { - log.info("Building " + format + " started"); - long t1 = System.currentTimeMillis(); - - template = expandRepeats(ctx, template, 1); - - Map mm = new HashMap<>(); - for (String s : ctx.getAttributeKeySet()) - mm.put(s, ctx.getAttribute(s)); - - StringBuilder ss = new StringBuilder(); - int i = 0; - while (i < template.length()) { - int i1 = template.indexOf("${", i); - if (i1 < 0) { - ss.append(template.substring(i)); - break; - } - - int i2 = template.indexOf('}', i1 + 2); - if (i2 < 0) - throw new RuntimeException("Template error: Matching } not found"); - - String var1 = template.substring(i1 + 2, i2); - String value1 = format == Format.XML ? XmlJsonUtil.getXml(mm, var1) : XmlJsonUtil.getJson(mm, var1); - // log.info(" " + var1 + ": " + value1); - if (value1 == null || value1.trim().length() == 0) { - // delete the whole element (line) - int i3 = template.lastIndexOf('\n', i1); - if (i3 < 0) - i3 = 0; - int i4 = template.indexOf('\n', i1); - if (i4 < 0) - i4 = template.length(); - - if (i < i3) - ss.append(template.substring(i, i3)); - i = i4; - } else { - ss.append(template.substring(i, i1)).append(value1); - i = i2 + 1; - } - } - - String req = format == Format.XML - ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) : XmlJsonUtil.removeEmptyStructJson(ss.toString()); - - if (format == Format.JSON) - req = XmlJsonUtil.removeLastCommaJson(req); - - long t2 = System.currentTimeMillis(); - log.info("Building " + format + " completed. Time: " + (t2 - t1)); - - return req; - } - - protected String expandRepeats(SvcLogicContext ctx, String template, int level) { - StringBuilder newTemplate = new StringBuilder(); - int k = 0; - while (k < template.length()) { - int i1 = template.indexOf("${repeat:", k); - if (i1 < 0) { - newTemplate.append(template.substring(k)); - break; - } - - int i2 = template.indexOf(':', i1 + 9); - if (i2 < 0) - throw new RuntimeException( - "Template error: Context variable name followed by : is required after repeat"); - - // Find the closing }, store in i3 - int nn = 1; - int i3 = -1; - int i = i2; - while (nn > 0 && i < template.length()) { - i3 = template.indexOf('}', i); - if (i3 < 0) - throw new RuntimeException("Template error: Matching } not found"); - int i32 = template.indexOf('{', i); - if (i32 >= 0 && i32 < i3) { - nn++; - i = i32 + 1; - } else { - nn--; - i = i3 + 1; - } - } - - String var1 = template.substring(i1 + 9, i2); - String value1 = ctx.getAttribute(var1); - log.info(" " + var1 + ": " + value1); - int n = 0; - try { - n = Integer.parseInt(value1); - } catch (Exception e) { - n = 0; - } - - newTemplate.append(template.substring(k, i1)); - - String rpt = template.substring(i2 + 1, i3); - - for (int ii = 0; ii < n; ii++) { - String ss = rpt.replaceAll("\\[\\$\\{" + level + "\\}\\]", "[" + ii + "]"); - if (ii == n - 1 && ss.trim().endsWith(",")) { - int i4 = ss.lastIndexOf(','); - if (i4 > 0) - ss = ss.substring(0, i4) + ss.substring(i4 + 1); - } - newTemplate.append(ss); - } - - k = i3 + 1; - } - - if (k == 0) - return newTemplate.toString(); - - return expandRepeats(ctx, newTemplate.toString(), level + 1); - } - - protected String readFile(String fileName) throws Exception { - byte[] encoded = Files.readAllBytes(Paths.get(fileName)); - return new String(encoded, "UTF-8"); - } - - protected HttpResponse sendHttpRequest(String request, Parameters p) throws Exception { - ClientConfig config = new DefaultClientConfig(); - SSLContext ssl = null; - if (p.ssl && p.restapiUrl.startsWith("https")) - ssl = createSSLContext(p); - if (ssl != null) { - HostnameVerifier hostnameVerifier = new HostnameVerifier() { - - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - - config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, - new HTTPSProperties(hostnameVerifier, ssl)); - } - - logProperties(config.getProperties()); - - Client client = Client.create(config); - client.setConnectTimeout(5000); - if (p.restapiUser != null) - client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); - WebResource webResource = client.resource(p.restapiUrl); - - log.info("Sending request:"); - log.info(request); - long t1 = System.currentTimeMillis(); - - HttpResponse r = new HttpResponse(); - r.code = 200; - - if (!p.skipSending) { - String tt = p.format == Format.XML ? "application/xml" : "application/json"; - String tt1 = tt + ";charset=UTF-8"; - if (p.contentType != null) { - tt = p.contentType; - tt1 = p.contentType; - } - - WebResource.Builder webResourceBuilder = webResource.accept(tt).type(tt1); - - if (p.customHttpHeaders != null && p.customHttpHeaders.length() > 0) { - String[] keyValuePairs = p.customHttpHeaders.split(","); - for (String singlePair : keyValuePairs) { - int equalPosition = singlePair.indexOf('='); - webResourceBuilder.header(singlePair.substring(0, equalPosition), singlePair.substring(equalPosition + 1, singlePair.length())); - } - } - - webResourceBuilder.header("X-ECOMP-RequestID",org.slf4j.MDC.get("X-ECOMP-RequestID")); - - ClientResponse response = webResourceBuilder.method(p.httpMethod.toString(), ClientResponse.class, request); - - r.code = response.getStatus(); - r.headers = response.getHeaders(); - EntityTag etag = response.getEntityTag(); - if (etag != null) - r.message = etag.getValue(); - if (response.hasEntity() && r.code != 204) - r.body = response.getEntity(String.class); - } - - long t2 = System.currentTimeMillis(); - log.info("Response received. Time: " + (t2 - t1)); - log.info("HTTP response code: " + r.code); - log.info("HTTP response message: " + r.message); - logHeaders(r.headers); - log.info("HTTP response: " + r.body); - - return r; - } - - protected SSLContext createSSLContext(Parameters p) { - try { - System.setProperty("jsse.enableSNIExtension", "false"); - System.setProperty("javax.net.ssl.trustStore", p.trustStoreFileName); - System.setProperty("javax.net.ssl.trustStorePassword", p.trustStorePassword); - - HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { - - @Override - public boolean verify(String string, SSLSession ssls) { - return true; - } - }); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); - FileInputStream in = new FileInputStream(p.keyStoreFileName); - KeyStore ks = KeyStore.getInstance("PKCS12"); - char[] pwd = p.keyStorePassword.toCharArray(); - ks.load(in, pwd); - kmf.init(ks, pwd); - - SSLContext ctx = SSLContext.getInstance("TLS"); - ctx.init(kmf.getKeyManagers(), null, null); - return ctx; - } catch (Exception e) { - log.error("Error creating SSLContext: " + e.getMessage(), e); - } - return null; - } - - protected void setFailureResponseStatus(SvcLogicContext ctx, String prefix, String errorMessage, HttpResponse r) { - r = new HttpResponse(); - r.code = 500; - r.message = errorMessage; - String pp = prefix != null ? prefix + '.' : ""; - ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); - ctx.setAttribute(pp + "response-message", r.message); - } - - protected void setResponseStatus(SvcLogicContext ctx, String prefix, HttpResponse r) { - String pp = prefix != null ? prefix + '.' : ""; - ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); - ctx.setAttribute(pp + "response-message", r.message); - } - - public void sendFile(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - HttpResponse r = null; - try { - FileParam p = getFileParameters(paramMap); - byte[] data = Files.readAllBytes(Paths.get(p.fileName)); - - r = sendHttpData(data, p); - setResponseStatus(ctx, p.responsePrefix, r); - - } catch (Exception e) { - log.error("Error sending the request: " + e.getMessage(), e); - - r = new HttpResponse(); - r.code = 500; - r.message = e.getMessage(); - String prefix = parseParam(paramMap, "responsePrefix", false, null); - setResponseStatus(ctx, prefix, r); - } - - if (r != null && r.code >= 300) - throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); - } - - private static class FileParam { - - public String fileName; - public String url; - public String user; - public String password; - public HttpMethod httpMethod; - public String responsePrefix; - public boolean skipSending; - } - - private FileParam getFileParameters(Map paramMap) throws SvcLogicException { - FileParam p = new FileParam(); - p.fileName = parseParam(paramMap, "fileName", true, null); - p.url = parseParam(paramMap, "url", true, null); - p.user = parseParam(paramMap, "user", false, null); - p.password = parseParam(paramMap, "password", false, null); - p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); - p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); - String skipSendingStr = paramMap.get("skipSending"); - p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); - return p; - } - - protected HttpResponse sendHttpData(byte[] data, FileParam p) { - Client client = Client.create(); - client.setConnectTimeout(5000); - client.setFollowRedirects(true); - if (p.user != null) - client.addFilter(new HTTPBasicAuthFilter(p.user, p.password)); - WebResource webResource = client.resource(p.url); - - log.info("Sending file"); - long t1 = System.currentTimeMillis(); - - HttpResponse r = new HttpResponse(); - r.code = 200; - - if (!p.skipSending) { - String tt = "application/octet-stream"; - - ClientResponse response = null; - if (p.httpMethod == HttpMethod.POST) - response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); - else if (p.httpMethod == HttpMethod.PUT) - response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); - - r.code = response.getStatus(); - r.headers = response.getHeaders(); - EntityTag etag = response.getEntityTag(); - if (etag != null) - r.message = etag.getValue(); - if (response.hasEntity() && r.code != 204) - r.body = response.getEntity(String.class); - - if (r.code == 301) { - String newUrl = response.getHeaders().getFirst("Location"); - - log.info("Got response code 301. Sending same request to URL: " + newUrl); - - webResource = client.resource(newUrl); - - if (p.httpMethod == HttpMethod.POST) - response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); - else if (p.httpMethod == HttpMethod.PUT) - response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); - - r.code = response.getStatus(); - etag = response.getEntityTag(); - if (etag != null) - r.message = etag.getValue(); - if (response.hasEntity() && r.code != 204) - r.body = response.getEntity(String.class); - } - } - - long t2 = System.currentTimeMillis(); - log.info("Response received. Time: " + (t2 - t1)); - log.info("HTTP response code: " + r.code); - log.info("HTTP response message: " + r.message); - logHeaders(r.headers); - log.info("HTTP response: " + r.body); - - return r; - } - - public void postMessageOnUeb(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - HttpResponse r = null; - try { - UebParam p = getUebParameters(paramMap); - - String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; - - String req = null; - - if (p.templateFileName == null) { - log.info("No template file name specified. Using default UEB template: " + defaultUebTemplateFileName); - p.templateFileName = defaultUebTemplateFileName; - } - - String reqTemplate = readFile(p.templateFileName); - reqTemplate = reqTemplate.replaceAll("rootVarName", p.rootVarName); - req = buildXmlJsonRequest(ctx, reqTemplate, Format.JSON); - - r = postOnUeb(req, p); - setResponseStatus(ctx, p.responsePrefix, r); - if (r.body != null) - ctx.setAttribute(pp + "httpResponse", r.body); - - } catch (Exception e) { - log.error("Error sending the request: " + e.getMessage(), e); - - r = new HttpResponse(); - r.code = 500; - r.message = e.getMessage(); - String prefix = parseParam(paramMap, "responsePrefix", false, null); - setResponseStatus(ctx, prefix, r); - } - - if (r != null && r.code >= 300) - throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); - } - - private static class UebParam { - - public String topic; - public String templateFileName; - public String rootVarName; - public String responsePrefix; - public boolean skipSending; - } - - private UebParam getUebParameters(Map paramMap) throws SvcLogicException { - UebParam p = new UebParam(); - p.topic = parseParam(paramMap, "topic", true, null); - p.templateFileName = parseParam(paramMap, "templateFileName", false, null); - p.rootVarName = parseParam(paramMap, "rootVarName", false, null); - p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); - String skipSendingStr = paramMap.get("skipSending"); - p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); - return p; - } - - protected HttpResponse postOnUeb(String request, UebParam p) throws Exception { - String[] urls = uebServers.split(" "); - for (int i = 0; i < urls.length; i++) { - if (!urls[i].endsWith("/")) - urls[i] += "/"; - urls[i] += "events/" + p.topic; - } - - Client client = Client.create(); - client.setConnectTimeout(5000); - WebResource webResource = client.resource(urls[0]); - - log.info("UEB URL: " + urls[0]); - log.info("Sending request:"); - log.info(request); - long t1 = System.currentTimeMillis(); - - HttpResponse r = new HttpResponse(); - r.code = 200; - - if (!p.skipSending) { - String tt = "application/json"; - String tt1 = tt + ";charset=UTF-8"; - - ClientResponse response = webResource.accept(tt).type(tt1).post(ClientResponse.class, request); - - r.code = response.getStatus(); - r.headers = response.getHeaders(); - if (response.hasEntity()) - r.body = response.getEntity(String.class); - } - - long t2 = System.currentTimeMillis(); - log.info("Response received. Time: " + (t2 - t1)); - log.info("HTTP response code: " + r.code); - logHeaders(r.headers); - log.info("HTTP response:\n" + r.body); - - return r; - } - - protected void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - log.info("Properties:"); - for (String name : ll) - log.info("--- " + name + ": " + String.valueOf(mm.get(name))); - } - - protected void logHeaders(MultivaluedMap mm) { - log.info("HTTP response headers:"); - - if (mm == null) - return; - - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - for (String name : ll) - log.info("--- " + name + ": " + String.valueOf(mm.get(name))); - } - - public void setUebServers(String uebServers) { - this.uebServers = uebServers; - } - - public void setDefaultUebTemplateFileName(String defaultUebTemplateFileName) { - this.defaultUebTemplateFileName = defaultUebTemplateFileName; - } -} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryException.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryException.java deleted file mode 100644 index bf6ccc056..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryException.java +++ /dev/null @@ -1,30 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -public class RetryException extends Exception { - - public RetryException(String message) { - super(message); - } - -} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicy.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicy.java deleted file mode 100644 index 2a27a1d02..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicy.java +++ /dev/null @@ -1,59 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -public class RetryPolicy { - private String[] hostnames; - private Integer maximumRetries; - - public Integer getMaximumRetries() { - return maximumRetries; - } - - public String getNextHostName(String uri) throws RetryException { - Integer position = null; - - for (int i = 0; i < hostnames.length; i++) { - if (uri.contains(hostnames[i])) { - position = i; - break; - } - } - - if(position == null){ - throw new RetryException("No match found for the provided uri[" + uri + "] so the next host name could not be retreived"); - } - position++; - - if (position > hostnames.length - 1) { - position = 0; - } - return hostnames[position]; - } - - public RetryPolicy(String[] hostnames, Integer maximumRetries){ - this.hostnames = hostnames; - this.maximumRetries = maximumRetries; - } - - -} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicyStore.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicyStore.java deleted file mode 100644 index baf60d2e8..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/RetryPolicyStore.java +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -import java.util.HashMap; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RetryPolicyStore { - private static final Logger log = LoggerFactory.getLogger(RetryPolicyStore.class); - - HashMap retryPolicies; - public String proxyServers; - - public String getProxyServers() { - return proxyServers; - } - - public void setProxyServers(String admServers) { - this.proxyServers = admServers; - String[] adminServersArray = admServers.split(","); - RetryPolicy adminPortalRetry = new RetryPolicy(adminServersArray, adminServersArray.length); - retryPolicies.put("dme2proxy", adminPortalRetry); - } - - public RetryPolicyStore() { - retryPolicies = new HashMap(); - } - - public RetryPolicy getRetryPolicy(String policyName) { - return (this.retryPolicies.get(policyName)); - } - -} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlJsonUtil.java deleted file mode 100644 index 66bf08b3d..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlJsonUtil.java +++ /dev/null @@ -1,372 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class XmlJsonUtil { - - private static final Logger log = LoggerFactory.getLogger(XmlJsonUtil.class); - - public static String getXml(Map varmap, String var) { - boolean escape = true; - if (var.startsWith("'")) { - var = var.substring(1); - escape = false; - } - - Object o = createStructure(varmap, var); - return generateXml(o, 0, escape); - } - - public static String getJson(Map varmap, String var) { - boolean escape = true; - if (var.startsWith("'")) { - var = var.substring(1); - escape = false; - } - - Object o = createStructure(varmap, var); - return generateJson(o, escape); - } - - private static Object createStructure(Map flatmap, String var) { - if (flatmap.containsKey(var)) { - if (var.endsWith("_length") || var.endsWith("].key")) - return null; - return flatmap.get(var); - } - - Map mm = new HashMap<>(); - for (String k : flatmap.keySet()) - if (k.startsWith(var + ".")) { - int i1 = k.indexOf('.', var.length() + 1); - int i2 = k.indexOf('[', var.length() + 1); - int i3 = k.length(); - if (i1 > 0 && i1 < i3) - i3 = i1; - if (i2 > 0 && i2 < i3) - i3 = i2; - String k1 = k.substring(var.length() + 1, i3); - String var1 = k.substring(0, i3); - if (!mm.containsKey(k1)) { - Object str = createStructure(flatmap, var1); - if (str != null && (!(str instanceof String) || ((String) str).trim().length() > 0)) - mm.put(k1, str); - } - } - if (!mm.isEmpty()) - return mm; - - boolean arrayFound = false; - for (String k : flatmap.keySet()) - if (k.startsWith(var + "[")) { - arrayFound = true; - break; - } - - if (arrayFound) { - List ll = new ArrayList<>(); - - int length = Integer.MAX_VALUE; - String lengthStr = flatmap.get(var + "_length"); - if (lengthStr != null) { - try { - length = Integer.parseInt(lengthStr); - } catch (Exception e) { - log.warn("Invalid number for " + var + "_length:" + lengthStr); - } - } - - for (int i = 0; i < length; i++) { - Object v = createStructure(flatmap, var + '[' + i + ']'); - if (v == null) - break; - ll.add(v); - } - - if (!ll.isEmpty()) - return ll; - } - - return null; - } - - @SuppressWarnings("unchecked") - private static String generateXml(Object o, int indent, boolean escape) { - if (o == null) - return null; - - if (o instanceof String) - return escape ? escapeXml((String) o) : (String) o;; - - if (o instanceof Map) { - StringBuilder ss = new StringBuilder(); - Map mm = (Map) o; - for (String k : mm.keySet()) { - Object v = mm.get(k); - if (v instanceof String) { - String s = escape ? escapeXml((String) v) : (String) v; - ss.append(pad(indent)).append('<').append(k).append('>'); - ss.append(s); - ss.append("').append('\n'); - } else if (v instanceof Map) { - ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); - ss.append(generateXml(v, indent + 1, escape)); - ss.append(pad(indent)).append("').append('\n'); - } else if (v instanceof List) { - List ll = (List) v; - for (Object o1 : ll) { - ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); - ss.append(generateXml(o1, indent + 1, escape)); - ss.append(pad(indent)).append("').append('\n'); - } - } - } - return ss.toString(); - } - - return null; - } - - private static String generateJson(Object o, boolean escape) { - if (o == null) - return null; - - StringBuilder ss = new StringBuilder(); - generateJson(ss, o, 0, false, escape); - return ss.toString(); - } - - @SuppressWarnings("unchecked") - private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape) { - if (o instanceof String) { - String s = escape ? escapeJson((String) o) : (String) o; - if (padFirst) - ss.append(pad(indent)); - ss.append('"').append(s).append('"'); - return; - } - - if (o instanceof Map) { - Map mm = (Map) o; - - if (padFirst) - ss.append(pad(indent)); - ss.append("{\n"); - - boolean first = true; - for (String k : mm.keySet()) { - if (!first) - ss.append(",\n"); - first = false; - - Object v = mm.get(k); - ss.append(pad(indent + 1)).append('"').append(k).append("\": "); - generateJson(ss, v, indent + 1, false, escape); - } - - ss.append("\n"); - ss.append(pad(indent)).append('}'); - - return; - } - - if (o instanceof List) { - List ll = (List) o; - - if (padFirst) - ss.append(pad(indent)); - ss.append("[\n"); - - boolean first = true; - for (Object o1 : ll) { - if (!first) - ss.append(",\n"); - first = false; - - generateJson(ss, o1, indent + 1, true, escape); - } - - ss.append("\n"); - ss.append(pad(indent)).append(']'); - } - } - - public static String removeLastCommaJson(String s) { - StringBuilder sb = new StringBuilder(); - int k = 0; - int start = 0; - while (k < s.length()) { - int i11 = s.indexOf('}', k); - int i12 = s.indexOf(']', k); - int i1 = -1; - if (i11 < 0) - i1 = i12; - else if (i12 < 0) - i1 = i11; - else - i1 = i11 < i12 ? i11 : i12; - if (i1 < 0) - break; - - int i2 = s.lastIndexOf(',', i1); - if (i2 < 0) { - k = i1 + 1; - continue; - } - - String between = s.substring(i2 + 1, i1); - if (between.trim().length() > 0) { - k = i1 + 1; - continue; - } - - sb.append(s.substring(start, i2)); - start = i2 + 1; - k = i1 + 1; - } - - sb.append(s.substring(start, s.length())); - - return sb.toString(); - } - - public static String removeEmptyStructJson(String s) { - int k = 0; - while (k < s.length()) { - boolean curly = true; - int i11 = s.indexOf('{', k); - int i12 = s.indexOf('[', k); - int i1 = -1; - if (i11 < 0) { - i1 = i12; - curly = false; - } else if (i12 < 0) - i1 = i11; - else - if (i11 < i12) - i1 = i11; - else { - i1 = i12; - curly = false; - } - - if (i1 >= 0) { - int i2 = curly ? s.indexOf('}', i1) : s.indexOf(']', i1); - if (i2 > 0) { - String value = s.substring(i1 + 1, i2); - if (value.trim().length() == 0) { - int i4 = s.lastIndexOf('\n', i1); - if (i4 < 0) - i4 = 0; - int i5 = s.indexOf('\n', i2); - if (i5 < 0) - i5 = s.length(); - - s = s.substring(0, i4) + s.substring(i5); - k = 0; - } else - k = i1 + 1; - } else - break; - } else - break; - } - - return s; - } - - public static String removeEmptyStructXml(String s) { - int k = 0; - while (k < s.length()) { - int i1 = s.indexOf('<', k); - if (i1 < 0 || i1 == s.length() - 1) - break; - - char c1 = s.charAt(i1 + 1); - if (c1 == '?' || c1 == '!') { - k = i1 + 2; - continue; - } - - int i2 = s.indexOf('>', i1); - if (i2 < 0) { - k = i1 + 1; - continue; - } - - String closingTag = " 0) { - k = i2 + 1; - continue; - } - - int i4 = s.lastIndexOf('\n', i1); - if (i4 < 0) - i4 = 0; - int i5 = s.indexOf('\n', i3); - if (i5 < 0) - i5 = s.length(); - - s = s.substring(0, i4) + s.substring(i5); - k = 0; - } - - return s; - } - - private static String escapeXml(String v) { - String s = v.replaceAll("&", "&"); - s = s.replaceAll("<", "<"); - s = s.replaceAll("'", "'"); - s = s.replaceAll("\"", """); - s = s.replaceAll(">", ">"); - return s; - } - - private static String escapeJson(String v) { - String s = v.replaceAll("\\\\", "\\\\\\\\"); - s = s.replaceAll("\"", "\\\\\""); - return s; - } - - private static String pad(int n) { - String s = ""; - for (int i = 0; i < n; i++) - s += '\t'; - return s; - } -} diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlParser.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlParser.java deleted file mode 100644 index e90a44fb8..000000000 --- a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/XmlParser.java +++ /dev/null @@ -1,160 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdnc.restapicall; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -public class XmlParser { - - private static final Logger log = LoggerFactory.getLogger(XmlParser.class); - - public static Map convertToProperties(String s, Set listNameList) { - Handler handler = new Handler(listNameList); - try { - SAXParserFactory factory = SAXParserFactory.newInstance(); - SAXParser saxParser = factory.newSAXParser(); - InputStream in = new ByteArrayInputStream(s.getBytes()); - saxParser.parse(in, handler); - } catch (Exception e) { - e.printStackTrace(); - } - - return handler.getProperties(); - } - - private static class Handler extends DefaultHandler { - - private Set listNameList; - - private Map properties = new HashMap<>(); - - public Map getProperties() { - return properties; - } - - public Handler(Set listNameList) { - super(); - this.listNameList = listNameList; - if (this.listNameList == null) - this.listNameList = new HashSet(); - } - - String currentName = ""; - String currentValue = ""; - - @Override - public void startElement(String uri, String localName, String qName, Attributes attributes) - throws SAXException { - super.startElement(uri, localName, qName, attributes); - - String name = localName; - if (name == null || name.trim().length() == 0) - name = qName; - int i2 = name.indexOf(':'); - if (i2 >= 0) - name = name.substring(i2 + 1); - - if (currentName.length() > 0) - currentName += '.'; - currentName += name; - - String listName = removeIndexes(currentName); - - if (listNameList.contains(listName)) { - int len = getInt(properties, currentName + "_length"); - properties.put(currentName + "_length", String.valueOf(len + 1)); - currentName += "[" + len + "]"; - } - } - - @Override - public void endElement(String uri, String localName, String qName) throws SAXException { - super.endElement(uri, localName, qName); - - String name = localName; - if (name == null || name.trim().length() == 0) - name = qName; - int i2 = name.indexOf(':'); - if (i2 >= 0) - name = name.substring(i2 + 1); - - if (currentValue.trim().length() > 0) { - currentValue = currentValue.trim(); - properties.put(currentName, currentValue); - - log.info("Added property: " + currentName + ": " + currentValue); - - currentValue = ""; - } - - int i1 = currentName.lastIndexOf("." + name); - if (i1 <= 0) - currentName = ""; - else - currentName = currentName.substring(0, i1); - } - - @Override - public void characters(char[] ch, int start, int length) throws SAXException { - super.characters(ch, start, length); - - String value = new String(ch, start, length); - currentValue += value; - } - - private static int getInt(Map mm, String name) { - String s = mm.get(name); - if (s == null) - return 0; - return Integer.parseInt(s); - } - - private String removeIndexes(String currentName) { - String s = ""; - boolean add = true; - for (int i = 0; i < currentName.length(); i++) { - char c = currentName.charAt(i); - if (c == '[') - add = false; - else if (c == ']') - add = true; - else if (add) - s += c; - } - return s; - } - } -} diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml index a7b1a8923..583563bc0 100644 --- a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml +++ b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml @@ -38,12 +38,12 @@ - + - + diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml index 09e3de783..7b74a899f 100644 --- a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml +++ b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml @@ -27,6 +27,6 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java new file mode 100644 index 000000000..a32b2f286 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.junit.Test; +import org.onap.ccsdk.sli.plugins.restapicall.JsonParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestJsonParser { + + private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); + + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json"))); + String ss = ""; + String line = null; + while ((line = in.readLine()) != null) + ss += line + '\n'; + + Map mm = JsonParser.convertToProperties(ss); + + logProperties(mm); + + in.close(); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java new file mode 100644 index 000000000..318a0a248 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -0,0 +1,92 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestRestapiCallNode { + + private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); + + + @Test + public void testDelete() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonTemplate() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java new file mode 100644 index 000000000..0346690a2 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java @@ -0,0 +1,215 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; +import org.onap.ccsdk.sli.plugins.restapicall.XmlJsonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class TestXmlJsonUtil { + + private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); + + @Test + public void test() { + Map mm = new HashMap<>(); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); + mm.put("service-data.service-information.service-instance-id", "someinstance001"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3_length", "2"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf_length", "1"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); + + mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); + mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); + mm.put("service-data.vnf-config-information.vendor", "Netconf"); + + mm.put("service-data.vnf-config-information.escape-test", "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); + + String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); + log.info(ss); + + ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); + log.info(ss); + } + + @Test + public void testRemoveEmptyStructXml() { + String xmlin = "" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmloutexpected = "" + + "\n" + + " \n" + + " blah\n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } + + @Test + public void testRemoveEmptyStructJson() { + String xmlin = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T3\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T4\":{\r\n" + + " \"T12\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T13\":[ ],\r\n" + + " \"T14\":{\r\n" + + " \"T15\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T16\":{\r\n" + + " \r\n" + + " }\r\n" + + " }\r\n" + + " },\r\n" + + " \"T5\":{\r\n" + + " \"T6\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T7\":[\r\n" + + " \"T8\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T9\":{ },\r\n" + + " \"T10\":\"blah\",\r\n" + + " \"T11\":[\r\n" + + " \r\n" + + " ]\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmloutexpected = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T5\":{\r\n" + + " \"T7\":[\r\n" + + " \"T10\":\"blah\",\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmlout = XmlJsonUtil.removeEmptyStructJson(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java new file mode 100644 index 000000000..a6d3d59ef --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.junit.Test; +import org.onap.ccsdk.sli.plugins.restapicall.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestXmlParser { + + private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); + + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml"))); + String ss = ""; + String line = null; + while ((line = in.readLine()) != null) + ss += line + '\n'; + + Set listNameList = new HashSet(); + listNameList.add("project.dependencies.dependency"); + listNameList.add("project.build.plugins.plugin"); + listNameList.add("project.build.plugins.plugin.executions.execution"); + listNameList.add("project.build.pluginManagement.plugins.plugin"); + listNameList.add( + "project.build.pluginManagement.plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); + + Map mm = XmlParser.convertToProperties(ss, listNameList); + + logProperties(mm); + + in.close(); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestJsonParser.java deleted file mode 100644 index 16fa68594..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestJsonParser.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.openecomp.sdnc.restapicall; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.junit.Test; -import org.openecomp.sdnc.restapicall.JsonParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestJsonParser { - - private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); - - @Test - public void test() throws Exception { - BufferedReader in = new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json"))); - String ss = ""; - String line = null; - while ((line = in.readLine()) != null) - ss += line + '\n'; - - Map mm = JsonParser.convertToProperties(ss); - - logProperties(mm); - - in.close(); - } - - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - log.info("Properties:"); - for (String name : ll) - log.info("--- " + name + ": " + mm.get(name)); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestRestapiCallNode.java deleted file mode 100644 index e0e58ad50..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestRestapiCallNode.java +++ /dev/null @@ -1,92 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.openecomp.sdnc.restapicall; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.openecomp.sdnc.restapicall.RestapiCallNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestRestapiCallNode { - - private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); - - - @Test - public void testDelete() throws Exception { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "pwd1"); - p.put("httpMethod", "delete"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testJsonTemplate() throws Exception { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlJsonUtil.java deleted file mode 100644 index dbcf98a98..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlJsonUtil.java +++ /dev/null @@ -1,215 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.openecomp.sdnc.restapicall; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.Assert; -import org.junit.Test; -import org.openecomp.sdnc.restapicall.XmlJsonUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class TestXmlJsonUtil { - - private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); - - @Test - public void test() { - Map mm = new HashMap<>(); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); - mm.put("service-data.service-information.service-instance-id", "someinstance001"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3_length", "2"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf_length", "1"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); - - mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); - mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); - mm.put("service-data.vnf-config-information.vendor", "Netconf"); - - mm.put("service-data.vnf-config-information.escape-test", "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); - - String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); - log.info(ss); - - ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); - log.info(ss); - } - - @Test - public void testRemoveEmptyStructXml() { - String xmlin = "" + - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " blah\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " blah blah\n" + - "\n"; - - String xmloutexpected = "" + - "\n" + - " \n" + - " blah\n" + - " \n" + - " blah blah\n" + - "\n"; - - String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); - log.info(xmlout); - - Assert.assertEquals(xmloutexpected, xmlout); - } - - @Test - public void testRemoveEmptyStructJson() { - String xmlin = "{\r\n" + - " \"T1\":{\r\n" + - " \"T2\":{\r\n" + - " \"T3\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T4\":{\r\n" + - " \"T12\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T13\":[ ],\r\n" + - " \"T14\":{\r\n" + - " \"T15\":{\r\n" + - " \r\n" + - " },\r\n" + - " \"T16\":{\r\n" + - " \r\n" + - " }\r\n" + - " }\r\n" + - " },\r\n" + - " \"T5\":{\r\n" + - " \"T6\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T7\":[\r\n" + - " \"T8\":{\r\n" + - " \r\n" + - " },\r\n" + - " \"T9\":{ },\r\n" + - " \"T10\":\"blah\",\r\n" + - " \"T11\":[\r\n" + - " \r\n" + - " ]\r\n" + - " ]\r\n" + - " }\r\n" + - " }\r\n" + - " }\r\n" + - "}\r\n" + - ""; - - String xmloutexpected = "{\r\n" + - " \"T1\":{\r\n" + - " \"T2\":{\r\n" + - " \"T5\":{\r\n" + - " \"T7\":[\r\n" + - " \"T10\":\"blah\",\r\n" + - " ]\r\n" + - " }\r\n" + - " }\r\n" + - " }\r\n" + - "}\r\n" + - ""; - - String xmlout = XmlJsonUtil.removeEmptyStructJson(xmlin); - log.info(xmlout); - - Assert.assertEquals(xmloutexpected, xmlout); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlParser.java deleted file mode 100644 index 980eded4e..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/openecomp/sdnc/restapicall/TestXmlParser.java +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.openecomp.sdnc.restapicall; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.junit.Test; -import org.openecomp.sdnc.restapicall.XmlParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestXmlParser { - - private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); - - @Test - public void test() throws Exception { - BufferedReader in = new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml"))); - String ss = ""; - String line = null; - while ((line = in.readLine()) != null) - ss += line + '\n'; - - Set listNameList = new HashSet(); - listNameList.add("project.dependencies.dependency"); - listNameList.add("project.build.plugins.plugin"); - listNameList.add("project.build.plugins.plugin.executions.execution"); - listNameList.add("project.build.pluginManagement.plugins.plugin"); - listNameList.add( - "project.build.pluginManagement.plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); - - Map mm = XmlParser.convertToProperties(ss, listNameList); - - logProperties(mm); - - in.close(); - } - - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - log.info("Properties:"); - for (String name : ll) - log.info("--- " + name + ": " + mm.get(name)); - } -} diff --git a/restapi-call-node/provider/src/test/resources/test.xml b/restapi-call-node/provider/src/test/resources/test.xml index 76205ddec..330064eab 100644 --- a/restapi-call-node/provider/src/test/resources/test.xml +++ b/restapi-call-node/provider/src/test/resources/test.xml @@ -23,7 +23,7 @@ 4.0.0 - org.openecomp.sdnctl + org.onap.ccsdk.sli.plugins restapi-call-node 6.0.0-SNAPSHOT @@ -47,12 +47,12 @@ test - org.openecomp.sdnctl + org.onap.ccsdk.sli sli-common compile - org.openecomp.sdnctl + org.onap.ccsdk.sli sli-provider compile @@ -99,7 +99,7 @@ com.brocade.developer providermodule-plugin - org.openecomp.sdnctl + org.onap.ccsdk.sli.plugins restapi-call-node @@ -119,8 +119,8 @@ true - org.openecomp.sdnc.restapicall - org.openecomp.sdnc.restapicall + org.onap.ccsdk.sli.plugins.restapicall + org.onap.ccsdk.sli.plugins.restapicall * diff --git a/restapi-call-node/provider/src/test/resources/test3.xml b/restapi-call-node/provider/src/test/resources/test3.xml index 2bf3be356..921161639 100644 --- a/restapi-call-node/provider/src/test/resources/test3.xml +++ b/restapi-call-node/provider/src/test/resources/test3.xml @@ -20,8 +20,8 @@ ============LICENSE_END========================================================= --> - + ICOREPVC-81114561 -- cgit 1.2.3-korg From 0c7f2223a42ae9f1a9ac8954e9b9194e929b72f6 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 15 Aug 2017 10:18:56 -0400 Subject: Port sli/plugins to Carbon Updated sli/plugins to compile against OpenDaylight Carbon SR1 Change-Id: I5ca937a5a9b51cb0dadd3648c71fe2c5dcefdcf1 Issue-ID: CCSDK-26 Signed-off-by: Dan Timoney --- pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/features/src/main/resources/features.xml | 4 ++-- properties-node/installer/pom.xml | 2 +- properties-node/installer/src/assembly/assemble_installer_zip.xml | 4 ++-- properties-node/installer/src/assembly/assemble_mvnrepo_zip.xml | 4 ++-- .../installer/src/main/resources/scripts/install-feature.sh | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- .../src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java | 4 ++-- .../src/main/resources/META-INF/spring/properties-node-context.xml | 4 ++-- .../main/resources/META-INF/spring/properties-node-osgi-context.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/features/src/main/resources/features.xml | 4 ++-- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/installer/src/assembly/assemble_installer_zip.xml | 4 ++-- restapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml | 4 ++-- .../installer/src/main/resources/scripts/install-feature.sh | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- .../src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java | 4 ++-- .../java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java | 4 ++-- .../java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 4 ++-- .../java/org/onap/ccsdk/sli/plugins/restapicall/RetryException.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java | 4 ++-- .../java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java | 4 ++-- .../src/main/resources/META-INF/spring/restapi-call-node-context.xml | 4 ++-- .../main/resources/META-INF/spring/restapi-call-node-osgi-context.xml | 4 ++-- .../provider/src/main/resources/northbound-api-template.xml | 4 ++-- .../jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java | 4 ++-- .../org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java | 4 ++-- .../jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java | 4 ++-- .../jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java | 4 ++-- restapi-call-node/provider/src/test/resources/test.xml | 4 ++-- restapi-call-node/provider/src/test/resources/test3.xml | 4 ++-- 40 files changed, 78 insertions(+), 78 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index 215f173fd..4af5fb508 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent - odlparent-boron-sr3 + odlparent-carbon-sr1 0.0.1-SNAPSHOT @@ -112,7 +112,7 @@ AT&T - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 159ac4740..d23d9979c 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -4,10 +4,10 @@ properties-node org.onap.ccsdk.sli.plugins - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT properties-node-features Properties Node - Features diff --git a/properties-node/features/src/main/resources/features.xml b/properties-node/features/src/main/resources/features.xml index 2ed98a124..5f0d7b55d 100644 --- a/properties-node/features/src/main/resources/features.xml +++ b/properties-node/features/src/main/resources/features.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 5749a9b99..7e6ae1740 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ properties-node org.onap.ccsdk.sli.plugins - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT properties-node-installer Properties node - Karaf Installer diff --git a/properties-node/installer/src/assembly/assemble_installer_zip.xml b/properties-node/installer/src/assembly/assemble_installer_zip.xml index e278872a1..3bed4b5ef 100644 --- a/properties-node/installer/src/assembly/assemble_installer_zip.xml +++ b/properties-node/installer/src/assembly/assemble_installer_zip.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/properties-node/installer/src/assembly/assemble_mvnrepo_zip.xml b/properties-node/installer/src/assembly/assemble_mvnrepo_zip.xml index 1edacdb6d..cb56f2cd4 100644 --- a/properties-node/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/properties-node/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/properties-node/installer/src/main/resources/scripts/install-feature.sh b/properties-node/installer/src/main/resources/scripts/install-feature.sh index 9a47d2225..e986764b9 100644 --- a/properties-node/installer/src/main/resources/scripts/install-feature.sh +++ b/properties-node/installer/src/main/resources/scripts/install-feature.sh @@ -4,8 +4,8 @@ # ============LICENSE_START======================================================= # openECOMP : SDN-C # ================================================================================ -# Copyright (C) 2017 ONAP Intellectual Property. All rights -# reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 8d6af7c57..44d89f924 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -3,7 +3,7 @@ org.onap.ccsdk.sli.plugins sdnc-plugins - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT 4.0.0 @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins properties-node - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT Properties Node This is an implementation of DG Execute Node that reads property file and diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 43369adf7..1c5eff74c 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -4,10 +4,10 @@ org.onap.ccsdk.sli.plugins properties-node - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT properties-node-provider bundle Properties Node - Provider diff --git a/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java b/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java index aa5663066..165b706be 100644 --- a/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java +++ b/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml index 048acc4aa..fd7ace8a5 100644 --- a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml +++ b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml index ce17a4611..19275fc9d 100644 --- a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml +++ b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index cf9473383..93ee00373 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -4,10 +4,10 @@ restapi-call-node org.onap.ccsdk.sli.plugins - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT restapi-call-node-features RESTAPI Call Node - Features diff --git a/restapi-call-node/features/src/main/resources/features.xml b/restapi-call-node/features/src/main/resources/features.xml index dbbe1b1c1..5a7f1f497 100644 --- a/restapi-call-node/features/src/main/resources/features.xml +++ b/restapi-call-node/features/src/main/resources/features.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index db0aae60d..9fa4496a1 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ restapi-call-node org.onap.ccsdk.sli.plugins - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT restapi-call-node-installer Properties node - Karaf Installer diff --git a/restapi-call-node/installer/src/assembly/assemble_installer_zip.xml b/restapi-call-node/installer/src/assembly/assemble_installer_zip.xml index e278872a1..3bed4b5ef 100644 --- a/restapi-call-node/installer/src/assembly/assemble_installer_zip.xml +++ b/restapi-call-node/installer/src/assembly/assemble_installer_zip.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/restapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml b/restapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml index 1edacdb6d..cb56f2cd4 100644 --- a/restapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/restapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/restapi-call-node/installer/src/main/resources/scripts/install-feature.sh b/restapi-call-node/installer/src/main/resources/scripts/install-feature.sh index 9a47d2225..e986764b9 100644 --- a/restapi-call-node/installer/src/main/resources/scripts/install-feature.sh +++ b/restapi-call-node/installer/src/main/resources/scripts/install-feature.sh @@ -4,8 +4,8 @@ # ============LICENSE_START======================================================= # openECOMP : SDN-C # ================================================================================ -# Copyright (C) 2017 ONAP Intellectual Property. All rights -# reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 86a27bb0d..e201c2708 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -3,7 +3,7 @@ org.onap.ccsdk.sli.plugins sdnc-plugins - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT 4.0.0 @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT RESTAPI Call Node This is an implementation of DG Execute Node that makes a call to an external REST API diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 4b328d3d0..0d695bb26 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -4,11 +4,11 @@ org.onap.ccsdk.sli.plugins restapi-call-node - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT bundle RESTAPI Call Node - Provider http://maven.apache.org diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java index 249378a06..573c85f78 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java index e991a72b3..40dfa3714 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java index 9fe449c75..66993aabc 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java index 2a9716079..f22aa0b39 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java index 8d1335cc5..1eed09e90 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 9de11fb0a..ef3145552 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryException.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryException.java index 2a8002819..03078c652 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryException.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryException.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java index 3059a4457..69334a969 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java index 18ec2fb76..b139da279 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java index 5131c8745..2fa3fa541 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java index 7a3243762..8f3febcaf 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml index 583563bc0..25ce0120a 100644 --- a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml +++ b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml index 7b74a899f..8f34005d5 100644 --- a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml +++ b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/main/resources/northbound-api-template.xml b/restapi-call-node/provider/src/main/resources/northbound-api-template.xml index 03530a729..5c2b9ad9a 100644 --- a/restapi-call-node/provider/src/main/resources/northbound-api-template.xml +++ b/restapi-call-node/provider/src/main/resources/northbound-api-template.xml @@ -2,8 +2,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java index a32b2f286..107e8c88e 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 318a0a248..5b03bff47 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java index 0346690a2..ad1c34e90 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java index a6d3d59ef..6d506ccec 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 ONAP Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/test/resources/test.xml b/restapi-call-node/provider/src/test/resources/test.xml index 330064eab..391c9b3e0 100644 --- a/restapi-call-node/provider/src/test/resources/test.xml +++ b/restapi-call-node/provider/src/test/resources/test.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/restapi-call-node/provider/src/test/resources/test3.xml b/restapi-call-node/provider/src/test/resources/test3.xml index 921161639..809a208eb 100644 --- a/restapi-call-node/provider/src/test/resources/test3.xml +++ b/restapi-call-node/provider/src/test/resources/test3.xml @@ -3,8 +3,8 @@ ============LICENSE_START======================================================= openECOMP : SDN-C ================================================================================ - Copyright (C) 2017 ONAP Intellectual Property. All rights - reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -- cgit 1.2.3-korg From 9042880234791fbe2e0ef033091ba93cb7f088f5 Mon Sep 17 00:00:00 2001 From: Marcus G K Williams Date: Wed, 23 Aug 2017 11:47:08 -0700 Subject: Conform ccsdk/sli/plugins to ONAP Style Per ONAP Style Guide: 1. Convert tabs to 4 spaces. 2. Break lines to be less than 120 characters 3. Clean ecomp references 4. Remove extraneous spaces Issue-Id: CCSDK-1 Change-Id: I5638326170aa3ab26774b373ab573643840e97ab Signed-off-by: Marcus G K Williams --- README.md | 4 +- pom.xml | 226 ++-- properties-node/features/pom.xml | 238 ++-- .../features/src/main/resources/features.xml | 22 +- properties-node/installer/pom.xml | 254 ++-- .../src/assembly/assemble_installer_zip.xml | 58 +- .../src/assembly/assemble_mvnrepo_zip.xml | 38 +- .../src/main/resources/scripts/install-feature.sh | 6 +- properties-node/pom.xml | 68 +- properties-node/provider/pom.xml | 152 +-- .../ccsdk/sli/plugins/prop/PropertiesNode.java | 100 +- .../META-INF/spring/properties-node-context.xml | 4 +- .../spring/properties-node-osgi-context.xml | 8 +- restapi-call-node/pom.xml | 66 +- restapi-call-node/provider/pom.xml | 176 +-- .../ccsdk/sli/plugins/restapicall/JsonParser.java | 96 +- .../sli/plugins/restapicall/RestapiCallNode.java | 1297 ++++++++++---------- .../ccsdk/sli/plugins/restapicall/RetryPolicy.java | 3 +- .../ccsdk/sli/plugins/restapicall/XmlJsonUtil.java | 676 +++++----- .../ccsdk/sli/plugins/restapicall/XmlParser.java | 236 ++-- .../META-INF/spring/restapi-call-node-context.xml | 30 +- .../spring/restapi-call-node-osgi-context.xml | 8 +- .../src/main/resources/default-ueb-message.json | 12 +- .../main/resources/northbound-api-template.json | 42 +- .../src/main/resources/northbound-api-template.xml | 2 +- .../sli/plugins/restapicall/TestJsonParser.java | 44 +- .../plugins/restapicall/TestRestapiCallNode.java | 100 +- .../sli/plugins/restapicall/TestXmlJsonUtil.java | 115 +- .../sli/plugins/restapicall/TestXmlParser.java | 58 +- .../provider/src/test/resources/test.json | 50 +- .../provider/src/test/resources/test.xml | 280 ++--- .../provider/src/test/resources/test3.xml | 116 +- 32 files changed, 2316 insertions(+), 2269 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/README.md b/README.md index 4e733caff..3ad2eae11 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -This source repository contains the code for the SDN Controller plugins. +This source repository contains the code for the CCSDK plugins. To compile this code: -1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains references to the OpenECOMP repositories and OpenDaylight repositories. See example-settings.xml for an example. +1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains references to the ONAP repositories and OpenDaylight repositories. See example-settings.xml for an example. 2. To compile, run "mvn clean install". diff --git a/pom.xml b/pom.xml index 4af5fb508..71303b796 100755 --- a/pom.xml +++ b/pom.xml @@ -1,118 +1,118 @@ - - - org.onap.ccsdk.parent - odlparent-carbon-sr1 - 0.0.1-SNAPSHOT - - - 4.0.0 - pom - org.onap.ccsdk.sli.plugins - sdnc-plugins - - SDN-C Java Plugins - https://wiki.onap.org - The SDN-C core components contains the SLI, dblib and root pom - - - - JIRA - https://jira.onap.org/ - - - - - scm:git:ssh://git@${onap.git.host}/ccsdk/sli/plugins.git - scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/ccsdk/sli/plugins.git - ${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/ccsdk/sli/plugins/browse - HEAD - - - - Jenkins - https://jenkins.onap.org - - - - - - sdnc-javadoc - dav:https://${onap.nexus.host}/content/sites/site/org/onap/sdnc/plugins/${project.artifactId}/${project.version} - - - - - - blackduck - - - blackduck-scan - - - - - - com.blackducksoftware.integration - hub-maven-plugin - 1.4.0 - false - - ${project.name} - ${project.basedir} - - - - create-bdio-file - package - - createHubOutput - - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.17 - - true - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - https://${onap.nexus.host} - ${onap.nexus.staging.profile-id} - ${onap.nexus.staging.server-id} - - - - - - - properties-node - restapi-call-node - - - AT&T - - 0.1.0-SNAPSHOT + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + + org.onap.ccsdk.parent + odlparent-carbon-sr1 + 0.0.1-SNAPSHOT + + + 4.0.0 + pom + org.onap.ccsdk.sli.plugins + sdnc-plugins + + SDN-C Java Plugins + https://wiki.onap.org + The SDN-C core components contains the SLI, dblib and root pom + + + + JIRA + https://jira.onap.org/ + + + + + scm:git:ssh://git@${onap.git.host}/ccsdk/sli/plugins.git + scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/ccsdk/sli/plugins.git + ${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/ccsdk/sli/plugins/browse + HEAD + + + + Jenkins + https://jenkins.onap.org + + + + + + sdnc-javadoc + dav:https://${onap.nexus.host}/content/sites/site/org/onap/sdnc/plugins/${project.artifactId}/${project.version} + + + + + + blackduck + + + blackduck-scan + + + + + + com.blackducksoftware.integration + hub-maven-plugin + 1.4.0 + false + + ${project.name} + ${project.basedir} + + + + create-bdio-file + package + + createHubOutput + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.17 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + https://${onap.nexus.host} + ${onap.nexus.staging.profile-id} + ${onap.nexus.staging.server-id} + + + + + + + properties-node + restapi-call-node + + + AT&T + + 0.1.0-SNAPSHOT diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index d23d9979c..5573d1e7a 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -1,135 +1,135 @@ - 4.0.0 - - properties-node - org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT - - org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT - properties-node-features - Properties Node - Features + 4.0.0 + + properties-node + org.onap.ccsdk.sli.plugins + 0.1.0-SNAPSHOT + + org.onap.ccsdk.sli.plugins + 0.1.0-SNAPSHOT + properties-node-features + Properties Node - Features - jar + jar - + - - org.onap.ccsdk.sli.plugins - properties-node-provider - ${project.version} - + + org.onap.ccsdk.sli.plugins + properties-node-provider + ${project.version} + - - commons-lang - commons-lang - 2.6 - compile - + + commons-lang + commons-lang + 2.6 + compile + - - org.opendaylight.mdsal - features-mdsal - ${odl.mdsal.features.version} - features - xml + + org.opendaylight.mdsal + features-mdsal + ${odl.mdsal.features.version} + features + xml - runtime - + runtime + - - - org.opendaylight.controller - opendaylight-karaf-empty - ${odl.karaf.empty.distro.version} - zip - + + + org.opendaylight.controller + opendaylight-karaf-empty + ${odl.karaf.empty.distro.version} + zip + - - - org.opendaylight.odlparent - features-test - ${odl.commons.opendaylight.version} - test - + + + org.opendaylight.odlparent + features-test + ${odl.commons.opendaylight.version} + test + - - org.opendaylight.yangtools - features-yangtools - ${odl.yangtools.version} - features - xml - runtime - - + + org.opendaylight.yangtools + features-yangtools + ${odl.yangtools.version} + features + xml + runtime + + - - - - true - src/main/resources - - - - - org.apache.maven.plugins - maven-resources-plugin - - - filter - - resources - - generate-resources - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/${features.file} - xml - features - - - - - - - - + org.apache.maven.plugins + maven-surefire-plugin + 2.16 + + + org.opendaylight.controller + opendaylight-karaf-empty + ${odl.karaf.empty.distro.version} + + + org.opendaylight.yangtools:features-test + + + + --> + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${project.build.directory}/classes/${features.file} + xml + features + + + + + + + + diff --git a/properties-node/features/src/main/resources/features.xml b/properties-node/features/src/main/resources/features.xml index 5f0d7b55d..96f37a9e0 100644 --- a/properties-node/features/src/main/resources/features.xml +++ b/properties-node/features/src/main/resources/features.xml @@ -22,18 +22,18 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0"> - mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features + mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features - - sdnc-sli - spring - spring-dm - mvn:org.onap.ccsdk.sli.plugins/properties-node-provider/${project.version} - - + + sdnc-sli + spring + spring-dm + mvn:org.onap.ccsdk.sli.plugins/properties-node-provider/${project.version} + + diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 7e6ae1740..570eced79 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -1,139 +1,139 @@ - 4.0.0 - - properties-node - org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT - - properties-node-installer - Properties node - Karaf Installer - pom + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + properties-node + org.onap.ccsdk.sli.plugins + 0.1.0-SNAPSHOT + + properties-node-installer + Properties node - Karaf Installer + pom - - sdnc-properties-node - sdnc-properties-node - mvn:org.onap.ccsdk.sli.plugins/properties-node-features/${project.version}/xml/features - false - + + sdnc-properties-node + sdnc-properties-node + mvn:org.onap.ccsdk.sli.plugins/properties-node-features/${project.version}/xml/features + false + - + - - org.onap.ccsdk.sli.plugins - properties-node-features - ${project.version} - features - xml - - - * - * - - - + + org.onap.ccsdk.sli.plugins + properties-node-features + ${project.version} + features + xml + + + * + * + + + - - org.onap.ccsdk.sli.plugins - properties-node-provider - ${project.version} - + + org.onap.ccsdk.sli.plugins + properties-node-provider + ${project.version} + - + - - - - maven-assembly-plugin - 2.6 - - - maven-repo-zip - - single - - package - - false - stage/${application.name}-${project.version} - - src/assembly/assemble_mvnrepo_zip.xml - - false - - - - installer-zip - - single - - package - - true - ${application.name}-${project.version}-installer - - src/assembly/assemble_installer_zip.xml - - false - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - - copy-dependencies - - prepare-package - - false - ${project.build.directory}/assembly/system - false - true - true - true - false - false - org.onap.ccsdk.sli - sli-common,sli-provider,dblib-provider - provided - - - - - - maven-resources-plugin - 2.6 - - - copy-version - - copy-resources - - validate - - ${basedir}/target/stage - - - src/main/resources/scripts - - install-feature.sh - - true - - - - + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + false + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + false + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli + sli-common,sli-provider,dblib-provider + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + - - + + - - + + diff --git a/properties-node/installer/src/assembly/assemble_installer_zip.xml b/properties-node/installer/src/assembly/assemble_installer_zip.xml index 3bed4b5ef..b6fd65582 100644 --- a/properties-node/installer/src/assembly/assemble_installer_zip.xml +++ b/properties-node/installer/src/assembly/assemble_installer_zip.xml @@ -22,37 +22,37 @@ - installer_zip - - zip - + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> + installer_zip + + zip + - - false + + false - - - target/stage/ - ${application.name} - 755 - - *.sh - - - - target/stage/ - ${application.name} - 644 - - *.sh - - - + + + target/stage/ + ${application.name} + 755 + + *.sh + + + + target/stage/ + ${application.name} + 644 + + *.sh + + + diff --git a/properties-node/installer/src/assembly/assemble_mvnrepo_zip.xml b/properties-node/installer/src/assembly/assemble_mvnrepo_zip.xml index cb56f2cd4..2ee224477 100644 --- a/properties-node/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/properties-node/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -22,27 +22,27 @@ - mvnrepo_zip - - zip - + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> + mvnrepo_zip + + zip + - - false + + false - - - target/assembly/ - . - - - - + + + target/assembly/ + . + + + + diff --git a/properties-node/installer/src/main/resources/scripts/install-feature.sh b/properties-node/installer/src/main/resources/scripts/install-feature.sh index e986764b9..df03392c8 100644 --- a/properties-node/installer/src/main/resources/scripts/install-feature.sh +++ b/properties-node/installer/src/main/resources/scripts/install-feature.sh @@ -30,10 +30,10 @@ REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip if [ -f ${REPOZIP} ] then - unzip -d ${ODL_HOME} ${REPOZIP} + unzip -d ${ODL_HOME} ${REPOZIP} else - echo "ERROR : repo zip ($REPOZIP) not found" - exit 1 + echo "ERROR : repo zip ($REPOZIP) not found" + exit 1 fi ${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:repo-add ${features.repositories} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 44d89f924..066db5e08 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -1,43 +1,43 @@ - - org.onap.ccsdk.sli.plugins - sdnc-plugins - 0.1.0-SNAPSHOT - + + org.onap.ccsdk.sli.plugins + sdnc-plugins + 0.1.0-SNAPSHOT + - 4.0.0 - pom + 4.0.0 + pom - org.onap.ccsdk.sli.plugins - properties-node - 0.1.0-SNAPSHOT + org.onap.ccsdk.sli.plugins + properties-node + 0.1.0-SNAPSHOT - Properties Node - This is an implementation of DG Execute Node that reads property file and - puts the properties in the DG context + Properties Node + This is an implementation of DG Execute Node that reads property file and + puts the properties in the DG context - - - - org.onap.ccsdk.sli.plugins - properties-node-features - features - xml - ${project.version} - - - org.onap.ccsdk.sli.plugins - properties-node-provider - ${project.version} - - - + + + + org.onap.ccsdk.sli.plugins + properties-node-features + features + xml + ${project.version} + + + org.onap.ccsdk.sli.plugins + properties-node-provider + ${project.version} + + + - - provider - features - installer - + + provider + features + installer + diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 1c5eff74c..a5249d98b 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -1,89 +1,89 @@ - 4.0.0 - - org.onap.ccsdk.sli.plugins - properties-node - 0.1.0-SNAPSHOT - - org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT - properties-node-provider - bundle - Properties Node - Provider - http://maven.apache.org - - UTF-8 - - - - junit - junit - test - - - org.springframework - spring-test - ${spring.version} - test - - - org.onap.ccsdk.sli.core - sli-common - ${sdnctl.sli.version} - compile - - - org.onap.ccsdk.sli.core - sli-provider - ${sdnctl.sli.version} - compile - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - jcl-over-slf4j - ${slf4j.version} - - - org.springframework - spring-beans - ${spring.version} - - - org.springframework - spring-context - ${spring.version} - - + 4.0.0 + + org.onap.ccsdk.sli.plugins + properties-node + 0.1.0-SNAPSHOT + + org.onap.ccsdk.sli.plugins + 0.1.0-SNAPSHOT + properties-node-provider + bundle + Properties Node - Provider + http://maven.apache.org + + UTF-8 + + + + junit + junit + test + + + org.springframework + spring-test + ${spring.version} + test + + + org.onap.ccsdk.sli.core + sli-common + ${sdnctl.sli.version} + compile + + + org.onap.ccsdk.sli.core + sli-provider + ${sdnctl.sli.version} + compile + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + - - + + - - org.apache.felix - maven-bundle-plugin - true - - - org.onap.ccsdk.sli.prop - org.onap.ccsdk.sli.prop - * - + + org.apache.felix + maven-bundle-plugin + true + + + org.onap.ccsdk.sli.prop + org.onap.ccsdk.sli.prop + * + - + - + - + - + diff --git a/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java b/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java index 165b706be..b4886d552 100644 --- a/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java +++ b/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java @@ -35,63 +35,63 @@ import org.slf4j.LoggerFactory; public class PropertiesNode implements SvcLogicJavaPlugin { - private static final Logger log = LoggerFactory.getLogger(PropertiesNode.class); + private static final Logger log = LoggerFactory.getLogger(PropertiesNode.class); - public void readProperties(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - String fileName = parseParam(paramMap, "fileName", true, null); - String contextPrefix = parseParam(paramMap, "contextPrefix", false, null); + public void readProperties(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + String fileName = parseParam(paramMap, "fileName", true, null); + String contextPrefix = parseParam(paramMap, "contextPrefix", false, null); - try { - Properties pp = new Properties(); - InputStream in = new FileInputStream(fileName); - pp.load(in); - for (Object key : pp.keySet()) { - String pfx = contextPrefix != null ? contextPrefix + '.' : ""; - String name = (String) key; - String value = pp.getProperty(name); - if (value != null && value.trim().length() > 0) { - ctx.setAttribute(pfx + name, value.trim()); - log.info("+++ " + pfx + name + ": [" + value + "]"); - } - } - } catch (IOException e) { - throw new SvcLogicException("Cannot read property file: " + fileName + ": " + e.getMessage(), e); - } - } + try { + Properties pp = new Properties(); + InputStream in = new FileInputStream(fileName); + pp.load(in); + for (Object key : pp.keySet()) { + String pfx = contextPrefix != null ? contextPrefix + '.' : ""; + String name = (String) key; + String value = pp.getProperty(name); + if (value != null && value.trim().length() > 0) { + ctx.setAttribute(pfx + name, value.trim()); + log.info("+++ " + pfx + name + ": [" + value + "]"); + } + } + } catch (IOException e) { + throw new SvcLogicException("Cannot read property file: " + fileName + ": " + e.getMessage(), e); + } + } - private String parseParam(Map paramMap, String name, boolean required, String def) - throws SvcLogicException { - String s = paramMap.get(name); + private String parseParam(Map paramMap, String name, boolean required, String def) + throws SvcLogicException { + String s = paramMap.get(name); - if (s == null || s.trim().length() == 0) { - if (!required) - return def; - throw new SvcLogicException("Parameter " + name + " is required in PropertiesNode"); - } + if (s == null || s.trim().length() == 0) { + if (!required) + return def; + throw new SvcLogicException("Parameter " + name + " is required in PropertiesNode"); + } - s = s.trim(); - String value = ""; - int i = 0; - int i1 = s.indexOf('%'); - while (i1 >= 0) { - int i2 = s.indexOf('%', i1 + 1); - if (i2 < 0) - throw new SvcLogicException("Cannot parse parameter " + name + ": " + s + ": no matching %"); + s = s.trim(); + String value = ""; + int i = 0; + int i1 = s.indexOf('%'); + while (i1 >= 0) { + int i2 = s.indexOf('%', i1 + 1); + if (i2 < 0) + throw new SvcLogicException("Cannot parse parameter " + name + ": " + s + ": no matching %"); - String varName = s.substring(i1 + 1, i2); - String varValue = System.getenv(varName); - if (varValue == null) - varValue = ""; + String varName = s.substring(i1 + 1, i2); + String varValue = System.getenv(varName); + if (varValue == null) + varValue = ""; - value += s.substring(i, i1); - value += varValue; + value += s.substring(i, i1); + value += varValue; - i = i2 + 1; - i1 = s.indexOf('%', i); - } - value += s.substring(i); + i = i2 + 1; + i1 = s.indexOf('%', i); + } + value += s.substring(i); - log.info("Parameter " + name + ": " + value); - return value; - } + log.info("Parameter " + name + ": " + value); + return value; + } } diff --git a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml index fd7ace8a5..52d1cd96a 100644 --- a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml +++ b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml @@ -26,7 +26,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - - + + diff --git a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml index 19275fc9d..a46e37c7b 100644 --- a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml +++ b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml @@ -21,12 +21,12 @@ --> - + diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index e201c2708..7e1886f43 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -1,42 +1,42 @@ - - org.onap.ccsdk.sli.plugins - sdnc-plugins - 0.1.0-SNAPSHOT - + + org.onap.ccsdk.sli.plugins + sdnc-plugins + 0.1.0-SNAPSHOT + - 4.0.0 - pom + 4.0.0 + pom - org.onap.ccsdk.sli.plugins - restapi-call-node - 0.1.0-SNAPSHOT + org.onap.ccsdk.sli.plugins + restapi-call-node + 0.1.0-SNAPSHOT - RESTAPI Call Node - This is an implementation of DG Execute Node that makes a call to an external REST API + RESTAPI Call Node + This is an implementation of DG Execute Node that makes a call to an external REST API - - - - org.onap.ccsdk.sli.plugins - restapi-call-node-features - features - xml - ${project.version} - - - org.onap.ccsdk.sli.plugins - restapi-call-node-provider - ${project.version} - - - + + + + org.onap.ccsdk.sli.plugins + restapi-call-node-features + features + xml + ${project.version} + + + org.onap.ccsdk.sli.plugins + restapi-call-node-provider + ${project.version} + + + - - provider - features - installer - + + provider + features + installer + diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 0d695bb26..ca3f004a0 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -1,101 +1,101 @@ - 4.0.0 - - org.onap.ccsdk.sli.plugins - restapi-call-node - 0.1.0-SNAPSHOT - - org.onap.ccsdk.sli.plugins - restapi-call-node-provider - 0.1.0-SNAPSHOT - bundle - RESTAPI Call Node - Provider - http://maven.apache.org - - UTF-8 - - - - junit - junit - test - - - org.springframework - spring-test - ${spring.version} - test - - - org.onap.ccsdk.sli.core - sli-common - ${sdnctl.sli.version} - compile - - - org.onap.ccsdk.sli.core - sli-provider - ${sdnctl.sli.version} - compile - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - jcl-over-slf4j - ${slf4j.version} - - - org.springframework - spring-beans - ${spring.version} - - - org.springframework - spring-context - ${spring.version} - - - com.sun.jersey - jersey-client - ${jersey.version} - provided - - - org.codehaus.jettison - jettison - ${jettison.version} - provided - - + 4.0.0 + + org.onap.ccsdk.sli.plugins + restapi-call-node + 0.1.0-SNAPSHOT + + org.onap.ccsdk.sli.plugins + restapi-call-node-provider + 0.1.0-SNAPSHOT + bundle + RESTAPI Call Node - Provider + http://maven.apache.org + + UTF-8 + + + + junit + junit + test + + + org.springframework + spring-test + ${spring.version} + test + + + org.onap.ccsdk.sli.core + sli-common + ${sdnctl.sli.version} + compile + + + org.onap.ccsdk.sli.core + sli-provider + ${sdnctl.sli.version} + compile + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + com.sun.jersey + jersey-client + ${jersey.version} + provided + + + org.codehaus.jettison + jettison + ${jettison.version} + provided + + - - + + - - org.apache.felix - maven-bundle-plugin - true - - - org.onap.ccsdk.sli.restapicall - org.onap.ccsdk.sli.plugins.restapicall - * - + + org.apache.felix + maven-bundle-plugin + true + + + org.onap.ccsdk.sli.restapicall + org.onap.ccsdk.sli.plugins.restapicall + * + - + - + - + - + diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java index f22aa0b39..4de4a34d7 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java @@ -34,52 +34,52 @@ import org.slf4j.LoggerFactory; public class JsonParser { - private static final Logger log = LoggerFactory.getLogger(JsonParser.class); - - @SuppressWarnings("unchecked") - public static Map convertToProperties(String s) throws JSONException { - JSONObject json = new JSONObject(s); - - Map wm = new HashMap(); - Iterator ii = json.keys(); - while (ii.hasNext()) { - String key1 = ii.next(); - wm.put(key1, json.get(key1)); - } - - Map mm = new HashMap(); - - while (!wm.isEmpty()) - for (String key : new ArrayList<>(wm.keySet())) { - Object o = wm.get(key); - wm.remove(key); - - if (o instanceof Boolean || o instanceof Number || o instanceof String) { - mm.put(key, o.toString()); - - log.info("Added property: " + key + ": " + o.toString()); - } - - else if (o instanceof JSONObject) { - JSONObject jo = (JSONObject) o; - Iterator i = jo.keys(); - while (i.hasNext()) { - String key1 = i.next(); - wm.put(key + "." + key1, jo.get(key1)); - } - } - - else if (o instanceof JSONArray) { - JSONArray ja = (JSONArray) o; - mm.put(key + "_length", String.valueOf(ja.length())); - - log.info("Added property: " + key + "_length" + ": " + String.valueOf(ja.length())); - - for (int i = 0; i < ja.length(); i++) - wm.put(key + '[' + i + ']', ja.get(i)); - } - } - - return mm; - } + private static final Logger log = LoggerFactory.getLogger(JsonParser.class); + + @SuppressWarnings("unchecked") + public static Map convertToProperties(String s) throws JSONException { + JSONObject json = new JSONObject(s); + + Map wm = new HashMap(); + Iterator ii = json.keys(); + while (ii.hasNext()) { + String key1 = ii.next(); + wm.put(key1, json.get(key1)); + } + + Map mm = new HashMap(); + + while (!wm.isEmpty()) + for (String key : new ArrayList<>(wm.keySet())) { + Object o = wm.get(key); + wm.remove(key); + + if (o instanceof Boolean || o instanceof Number || o instanceof String) { + mm.put(key, o.toString()); + + log.info("Added property: " + key + ": " + o.toString()); + } + + else if (o instanceof JSONObject) { + JSONObject jo = (JSONObject) o; + Iterator i = jo.keys(); + while (i.hasNext()) { + String key1 = i.next(); + wm.put(key + "." + key1, jo.get(key1)); + } + } + + else if (o instanceof JSONArray) { + JSONArray ja = (JSONArray) o; + mm.put(key + "_length", String.valueOf(ja.length())); + + log.info("Added property: " + key + "_length" + ": " + String.valueOf(ja.length())); + + for (int i = 0; i < ja.length(); i++) + wm.put(key + '[' + i + ']', ja.get(i)); + } + } + + return mm; + } } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index ef3145552..fb7722686 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -61,25 +61,25 @@ import com.sun.jersey.client.urlconnection.HTTPSProperties; public class RestapiCallNode implements SvcLogicJavaPlugin { - private static final Logger log = LoggerFactory.getLogger(RestapiCallNode.class); + private static final Logger log = LoggerFactory.getLogger(RestapiCallNode.class); - private String uebServers; - private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; - protected RetryPolicyStore retryPolicyStore; + private String uebServers; + private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; + protected RetryPolicyStore retryPolicyStore; - protected RetryPolicyStore getRetryPolicyStore() { - return retryPolicyStore; - } + protected RetryPolicyStore getRetryPolicyStore() { + return retryPolicyStore; + } - public void setRetryPolicyStore(RetryPolicyStore retryPolicyStore) { - this.retryPolicyStore = retryPolicyStore; - } + public void setRetryPolicyStore(RetryPolicyStore retryPolicyStore) { + this.retryPolicyStore = retryPolicyStore; + } - public RestapiCallNode() { + public RestapiCallNode() { - } + } - /** + /** * Allows Directed Graphs the ability to interact with REST APIs. * @param parameters HashMap of parameters passed by the DG to this function * @@ -106,654 +106,655 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { * @since 11.0.2 * @see String#split(String, int) */ - public void sendRequest(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - sendRequest(paramMap, ctx, null); - } - - public void sendRequest(Map paramMap, SvcLogicContext ctx, Integer retryCount) - throws SvcLogicException { - - RetryPolicy retryPolicy = null; - HttpResponse r = null; - try { - Parameters p = getParameters(paramMap); - if (p.partner != null) { - retryPolicy = retryPolicyStore.getRetryPolicy(p.partner); - } - String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; - - String req = null; - if (p.templateFileName != null) { - String reqTemplate = readFile(p.templateFileName); - req = buildXmlJsonRequest(ctx, reqTemplate, p.format); - } - r = sendHttpRequest(req, p); - setResponseStatus(ctx, p.responsePrefix, r); - - if (p.dumpHeaders && r.headers != null) { + public void sendRequest(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + sendRequest(paramMap, ctx, null); + } + + public void sendRequest(Map paramMap, SvcLogicContext ctx, Integer retryCount) + throws SvcLogicException { + + RetryPolicy retryPolicy = null; + HttpResponse r = null; + try { + Parameters p = getParameters(paramMap); + if (p.partner != null) { + retryPolicy = retryPolicyStore.getRetryPolicy(p.partner); + } + String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; + + String req = null; + if (p.templateFileName != null) { + String reqTemplate = readFile(p.templateFileName); + req = buildXmlJsonRequest(ctx, reqTemplate, p.format); + } + r = sendHttpRequest(req, p); + setResponseStatus(ctx, p.responsePrefix, r); + + if (p.dumpHeaders && r.headers != null) { for (Entry> a : r.headers.entrySet()) { ctx.setAttribute(pp + "header." + a.getKey(), StringUtils.join(a.getValue(), ",")); } } - if (r.body != null && r.body.trim().length() > 0) { - ctx.setAttribute(pp + "httpResponse", r.body); - - if (p.convertResponse) { - Map mm = null; - if (p.format == Format.XML) - mm = XmlParser.convertToProperties(r.body, p.listNameList); - else if (p.format == Format.JSON) - mm = JsonParser.convertToProperties(r.body); - - if (mm != null) - for (String key : mm.keySet()) - ctx.setAttribute(pp + key, mm.get(key)); - } - } - } catch (Exception e) { - boolean shouldRetry = false; - if (e.getCause() instanceof java.net.SocketException) { - shouldRetry = true; - } - - log.error("Error sending the request: " + e.getMessage(), e); - String prefix = parseParam(paramMap, "responsePrefix", false, null); - if (retryPolicy == null || shouldRetry == false) { - setFailureResponseStatus(ctx, prefix, e.getMessage(), r); - } else { - if (retryCount == null) { - retryCount = 0; - } - String retryMessage = retryCount + " attempts were made out of " + retryPolicy.getMaximumRetries() + - " maximum retries."; - log.debug(retryMessage); - try { - retryCount = retryCount + 1; - if (retryCount < retryPolicy.getMaximumRetries() + 1) { - URI uri = new URI(paramMap.get("restapiUrl")); - String hostname = uri.getHost(); - String retryString = retryPolicy.getNextHostName((uri.toString())); - URI uriTwo = new URI(retryString); - URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port(uriTwo.getPort()).scheme( - uriTwo.getScheme()).build(); - paramMap.put("restapiUrl", retryUri.toString()); - log.debug("URL was set to " + retryUri.toString()); - log.debug("Failed to communicate with host " + hostname + - ". Request will be re-attempted using the host " + retryString + "."); - log.debug("This is retry attempt " + retryCount + " out of " + retryPolicy.getMaximumRetries()); - sendRequest(paramMap, ctx, retryCount); - } else { - log.debug("Maximum retries reached, calling setFailureResponseStatus."); - setFailureResponseStatus(ctx, prefix, e.getMessage(), r); - } - } catch (Exception ex) { - log.error("Could not attempt retry.", ex); - String retryErrorMessage = - "Retry attempt has failed. No further retry shall be attempted, calling setFailureResponseStatus."; - setFailureResponseStatus(ctx, prefix, retryErrorMessage, r); - } - } - } - - if (r != null && r.code >= 300) - throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); - } - - protected Parameters getParameters(Map paramMap) throws SvcLogicException { - Parameters p = new Parameters(); - p.templateFileName = parseParam(paramMap, "templateFileName", false, null); - p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); - p.restapiUser = parseParam(paramMap, "restapiUser", false, null); - p.restapiPassword = parseParam(paramMap, "restapiPassword", false, null); - p.contentType = parseParam(paramMap, "contentType", false, null); - p.format = Format.fromString(parseParam(paramMap, "format", false, "json")); - p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); - p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); - p.listNameList = getListNameList(paramMap); - String skipSendingStr = paramMap.get("skipSending"); - p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); - p.convertResponse = Boolean.valueOf(parseParam(paramMap, "convertResponse", false, "true")); - p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", false, null); - p.trustStorePassword = parseParam(paramMap, "trustStorePassword", false, null); - p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", false, null); - p.keyStorePassword = parseParam(paramMap, "keyStorePassword", false, null); - p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null && p.keyStoreFileName != null && - p.keyStorePassword != null; - p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null); - p.partner = parseParam(paramMap, "partner", false, null); - p.dumpHeaders = Boolean.valueOf(parseParam(paramMap, "dumpHeaders", false, null)); - return p; - } - - protected Set getListNameList(Map paramMap) { - Set ll = new HashSet(); - for (String key : paramMap.keySet()) - if (key.startsWith("listName")) - ll.add(paramMap.get(key)); - return ll; - } - - protected String parseParam(Map paramMap, String name, boolean required, String def) - throws SvcLogicException { - String s = paramMap.get(name); - - if (s == null || s.trim().length() == 0) { - if (!required) - return def; - throw new SvcLogicException("Parameter " + name + " is required in RestapiCallNode"); - } - - s = s.trim(); - String value = ""; - int i = 0; - int i1 = s.indexOf('%'); - while (i1 >= 0) { - int i2 = s.indexOf('%', i1 + 1); - if (i2 < 0) - break; - - String varName = s.substring(i1 + 1, i2); - String varValue = System.getenv(varName); - if (varValue == null) - varValue = "%" + varName + "%"; - - value += s.substring(i, i1); - value += varValue; - - i = i2 + 1; - i1 = s.indexOf('%', i); - } - value += s.substring(i); - - log.info("Parameter " + name + ": [" + value + "]"); - return value; - } - - protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) { - log.info("Building " + format + " started"); - long t1 = System.currentTimeMillis(); - - template = expandRepeats(ctx, template, 1); - - Map mm = new HashMap<>(); - for (String s : ctx.getAttributeKeySet()) - mm.put(s, ctx.getAttribute(s)); - - StringBuilder ss = new StringBuilder(); - int i = 0; - while (i < template.length()) { - int i1 = template.indexOf("${", i); - if (i1 < 0) { - ss.append(template.substring(i)); - break; - } - - int i2 = template.indexOf('}', i1 + 2); - if (i2 < 0) - throw new RuntimeException("Template error: Matching } not found"); - - String var1 = template.substring(i1 + 2, i2); - String value1 = format == Format.XML ? XmlJsonUtil.getXml(mm, var1) : XmlJsonUtil.getJson(mm, var1); - // log.info(" " + var1 + ": " + value1); - if (value1 == null || value1.trim().length() == 0) { - // delete the whole element (line) - int i3 = template.lastIndexOf('\n', i1); - if (i3 < 0) - i3 = 0; - int i4 = template.indexOf('\n', i1); - if (i4 < 0) - i4 = template.length(); - - if (i < i3) - ss.append(template.substring(i, i3)); - i = i4; - } else { - ss.append(template.substring(i, i1)).append(value1); - i = i2 + 1; - } - } - - String req = format == Format.XML - ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) : XmlJsonUtil.removeEmptyStructJson(ss.toString()); - - if (format == Format.JSON) - req = XmlJsonUtil.removeLastCommaJson(req); - - long t2 = System.currentTimeMillis(); - log.info("Building " + format + " completed. Time: " + (t2 - t1)); - - return req; - } - - protected String expandRepeats(SvcLogicContext ctx, String template, int level) { - StringBuilder newTemplate = new StringBuilder(); - int k = 0; - while (k < template.length()) { - int i1 = template.indexOf("${repeat:", k); - if (i1 < 0) { - newTemplate.append(template.substring(k)); - break; - } - - int i2 = template.indexOf(':', i1 + 9); - if (i2 < 0) - throw new RuntimeException( - "Template error: Context variable name followed by : is required after repeat"); - - // Find the closing }, store in i3 - int nn = 1; - int i3 = -1; - int i = i2; - while (nn > 0 && i < template.length()) { - i3 = template.indexOf('}', i); - if (i3 < 0) - throw new RuntimeException("Template error: Matching } not found"); - int i32 = template.indexOf('{', i); - if (i32 >= 0 && i32 < i3) { - nn++; - i = i32 + 1; - } else { - nn--; - i = i3 + 1; - } - } - - String var1 = template.substring(i1 + 9, i2); - String value1 = ctx.getAttribute(var1); - log.info(" " + var1 + ": " + value1); - int n = 0; - try { - n = Integer.parseInt(value1); - } catch (Exception e) { - n = 0; - } - - newTemplate.append(template.substring(k, i1)); - - String rpt = template.substring(i2 + 1, i3); - - for (int ii = 0; ii < n; ii++) { - String ss = rpt.replaceAll("\\[\\$\\{" + level + "\\}\\]", "[" + ii + "]"); - if (ii == n - 1 && ss.trim().endsWith(",")) { - int i4 = ss.lastIndexOf(','); - if (i4 > 0) - ss = ss.substring(0, i4) + ss.substring(i4 + 1); - } - newTemplate.append(ss); - } - - k = i3 + 1; - } - - if (k == 0) - return newTemplate.toString(); - - return expandRepeats(ctx, newTemplate.toString(), level + 1); - } - - protected String readFile(String fileName) throws Exception { - byte[] encoded = Files.readAllBytes(Paths.get(fileName)); - return new String(encoded, "UTF-8"); - } - - protected HttpResponse sendHttpRequest(String request, Parameters p) throws Exception { - ClientConfig config = new DefaultClientConfig(); - SSLContext ssl = null; - if (p.ssl && p.restapiUrl.startsWith("https")) - ssl = createSSLContext(p); - if (ssl != null) { - HostnameVerifier hostnameVerifier = new HostnameVerifier() { - - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - - config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, - new HTTPSProperties(hostnameVerifier, ssl)); - } - - logProperties(config.getProperties()); - - Client client = Client.create(config); - client.setConnectTimeout(5000); - if (p.restapiUser != null) - client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); - WebResource webResource = client.resource(p.restapiUrl); - - log.info("Sending request:"); - log.info(request); - long t1 = System.currentTimeMillis(); - - HttpResponse r = new HttpResponse(); - r.code = 200; - - if (!p.skipSending) { - String tt = p.format == Format.XML ? "application/xml" : "application/json"; - String tt1 = tt + ";charset=UTF-8"; - if (p.contentType != null) { - tt = p.contentType; - tt1 = p.contentType; - } - - WebResource.Builder webResourceBuilder = webResource.accept(tt).type(tt1); + if (r.body != null && r.body.trim().length() > 0) { + ctx.setAttribute(pp + "httpResponse", r.body); + + if (p.convertResponse) { + Map mm = null; + if (p.format == Format.XML) + mm = XmlParser.convertToProperties(r.body, p.listNameList); + else if (p.format == Format.JSON) + mm = JsonParser.convertToProperties(r.body); + + if (mm != null) + for (String key : mm.keySet()) + ctx.setAttribute(pp + key, mm.get(key)); + } + } + } catch (Exception e) { + boolean shouldRetry = false; + if (e.getCause() instanceof java.net.SocketException) { + shouldRetry = true; + } + + log.error("Error sending the request: " + e.getMessage(), e); + String prefix = parseParam(paramMap, "responsePrefix", false, null); + if (retryPolicy == null || shouldRetry == false) { + setFailureResponseStatus(ctx, prefix, e.getMessage(), r); + } else { + if (retryCount == null) { + retryCount = 0; + } + String retryMessage = retryCount + " attempts were made out of " + retryPolicy.getMaximumRetries() + + " maximum retries."; + log.debug(retryMessage); + try { + retryCount = retryCount + 1; + if (retryCount < retryPolicy.getMaximumRetries() + 1) { + URI uri = new URI(paramMap.get("restapiUrl")); + String hostname = uri.getHost(); + String retryString = retryPolicy.getNextHostName((uri.toString())); + URI uriTwo = new URI(retryString); + URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port(uriTwo.getPort()).scheme( + uriTwo.getScheme()).build(); + paramMap.put("restapiUrl", retryUri.toString()); + log.debug("URL was set to " + retryUri.toString()); + log.debug("Failed to communicate with host " + hostname + + ". Request will be re-attempted using the host " + retryString + "."); + log.debug("This is retry attempt " + retryCount + " out of " + retryPolicy.getMaximumRetries()); + sendRequest(paramMap, ctx, retryCount); + } else { + log.debug("Maximum retries reached, calling setFailureResponseStatus."); + setFailureResponseStatus(ctx, prefix, e.getMessage(), r); + } + } catch (Exception ex) { + log.error("Could not attempt retry.", ex); + String retryErrorMessage = + "Retry attempt has failed. No further retry shall be attempted, calling setFailureResponseStatus."; + setFailureResponseStatus(ctx, prefix, retryErrorMessage, r); + } + } + } + + if (r != null && r.code >= 300) + throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); + } + + protected Parameters getParameters(Map paramMap) throws SvcLogicException { + Parameters p = new Parameters(); + p.templateFileName = parseParam(paramMap, "templateFileName", false, null); + p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); + p.restapiUser = parseParam(paramMap, "restapiUser", false, null); + p.restapiPassword = parseParam(paramMap, "restapiPassword", false, null); + p.contentType = parseParam(paramMap, "contentType", false, null); + p.format = Format.fromString(parseParam(paramMap, "format", false, "json")); + p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); + p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + p.listNameList = getListNameList(paramMap); + String skipSendingStr = paramMap.get("skipSending"); + p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + p.convertResponse = Boolean.valueOf(parseParam(paramMap, "convertResponse", false, "true")); + p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", false, null); + p.trustStorePassword = parseParam(paramMap, "trustStorePassword", false, null); + p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", false, null); + p.keyStorePassword = parseParam(paramMap, "keyStorePassword", false, null); + p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null && p.keyStoreFileName != null && + p.keyStorePassword != null; + p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null); + p.partner = parseParam(paramMap, "partner", false, null); + p.dumpHeaders = Boolean.valueOf(parseParam(paramMap, "dumpHeaders", false, null)); + return p; + } + + protected Set getListNameList(Map paramMap) { + Set ll = new HashSet(); + for (String key : paramMap.keySet()) + if (key.startsWith("listName")) + ll.add(paramMap.get(key)); + return ll; + } + + protected String parseParam(Map paramMap, String name, boolean required, String def) + throws SvcLogicException { + String s = paramMap.get(name); + + if (s == null || s.trim().length() == 0) { + if (!required) + return def; + throw new SvcLogicException("Parameter " + name + " is required in RestapiCallNode"); + } + + s = s.trim(); + String value = ""; + int i = 0; + int i1 = s.indexOf('%'); + while (i1 >= 0) { + int i2 = s.indexOf('%', i1 + 1); + if (i2 < 0) + break; + + String varName = s.substring(i1 + 1, i2); + String varValue = System.getenv(varName); + if (varValue == null) + varValue = "%" + varName + "%"; + + value += s.substring(i, i1); + value += varValue; + + i = i2 + 1; + i1 = s.indexOf('%', i); + } + value += s.substring(i); + + log.info("Parameter " + name + ": [" + value + "]"); + return value; + } + + protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) { + log.info("Building " + format + " started"); + long t1 = System.currentTimeMillis(); + + template = expandRepeats(ctx, template, 1); + + Map mm = new HashMap<>(); + for (String s : ctx.getAttributeKeySet()) + mm.put(s, ctx.getAttribute(s)); + + StringBuilder ss = new StringBuilder(); + int i = 0; + while (i < template.length()) { + int i1 = template.indexOf("${", i); + if (i1 < 0) { + ss.append(template.substring(i)); + break; + } + + int i2 = template.indexOf('}', i1 + 2); + if (i2 < 0) + throw new RuntimeException("Template error: Matching } not found"); + + String var1 = template.substring(i1 + 2, i2); + String value1 = format == Format.XML ? XmlJsonUtil.getXml(mm, var1) : XmlJsonUtil.getJson(mm, var1); + // log.info(" " + var1 + ": " + value1); + if (value1 == null || value1.trim().length() == 0) { + // delete the whole element (line) + int i3 = template.lastIndexOf('\n', i1); + if (i3 < 0) + i3 = 0; + int i4 = template.indexOf('\n', i1); + if (i4 < 0) + i4 = template.length(); + + if (i < i3) + ss.append(template.substring(i, i3)); + i = i4; + } else { + ss.append(template.substring(i, i1)).append(value1); + i = i2 + 1; + } + } + + String req = format == Format.XML + ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) : XmlJsonUtil.removeEmptyStructJson(ss.toString()); + + if (format == Format.JSON) + req = XmlJsonUtil.removeLastCommaJson(req); + + long t2 = System.currentTimeMillis(); + log.info("Building " + format + " completed. Time: " + (t2 - t1)); + + return req; + } + + protected String expandRepeats(SvcLogicContext ctx, String template, int level) { + StringBuilder newTemplate = new StringBuilder(); + int k = 0; + while (k < template.length()) { + int i1 = template.indexOf("${repeat:", k); + if (i1 < 0) { + newTemplate.append(template.substring(k)); + break; + } + + int i2 = template.indexOf(':', i1 + 9); + if (i2 < 0) + throw new RuntimeException( + "Template error: Context variable name followed by : is required after repeat"); + + // Find the closing }, store in i3 + int nn = 1; + int i3 = -1; + int i = i2; + while (nn > 0 && i < template.length()) { + i3 = template.indexOf('}', i); + if (i3 < 0) + throw new RuntimeException("Template error: Matching } not found"); + int i32 = template.indexOf('{', i); + if (i32 >= 0 && i32 < i3) { + nn++; + i = i32 + 1; + } else { + nn--; + i = i3 + 1; + } + } + + String var1 = template.substring(i1 + 9, i2); + String value1 = ctx.getAttribute(var1); + log.info(" " + var1 + ": " + value1); + int n = 0; + try { + n = Integer.parseInt(value1); + } catch (Exception e) { + n = 0; + } + + newTemplate.append(template.substring(k, i1)); + + String rpt = template.substring(i2 + 1, i3); + + for (int ii = 0; ii < n; ii++) { + String ss = rpt.replaceAll("\\[\\$\\{" + level + "\\}\\]", "[" + ii + "]"); + if (ii == n - 1 && ss.trim().endsWith(",")) { + int i4 = ss.lastIndexOf(','); + if (i4 > 0) + ss = ss.substring(0, i4) + ss.substring(i4 + 1); + } + newTemplate.append(ss); + } + + k = i3 + 1; + } + + if (k == 0) + return newTemplate.toString(); + + return expandRepeats(ctx, newTemplate.toString(), level + 1); + } + + protected String readFile(String fileName) throws Exception { + byte[] encoded = Files.readAllBytes(Paths.get(fileName)); + return new String(encoded, "UTF-8"); + } + + protected HttpResponse sendHttpRequest(String request, Parameters p) throws Exception { + ClientConfig config = new DefaultClientConfig(); + SSLContext ssl = null; + if (p.ssl && p.restapiUrl.startsWith("https")) + ssl = createSSLContext(p); + if (ssl != null) { + HostnameVerifier hostnameVerifier = new HostnameVerifier() { + + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + + config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, + new HTTPSProperties(hostnameVerifier, ssl)); + } + + logProperties(config.getProperties()); + + Client client = Client.create(config); + client.setConnectTimeout(5000); + if (p.restapiUser != null) + client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); + WebResource webResource = client.resource(p.restapiUrl); + + log.info("Sending request:"); + log.info(request); + long t1 = System.currentTimeMillis(); + + HttpResponse r = new HttpResponse(); + r.code = 200; + + if (!p.skipSending) { + String tt = p.format == Format.XML ? "application/xml" : "application/json"; + String tt1 = tt + ";charset=UTF-8"; + if (p.contentType != null) { + tt = p.contentType; + tt1 = p.contentType; + } + + WebResource.Builder webResourceBuilder = webResource.accept(tt).type(tt1); if (p.customHttpHeaders != null && p.customHttpHeaders.length() > 0) { String[] keyValuePairs = p.customHttpHeaders.split(","); for (String singlePair : keyValuePairs) { int equalPosition = singlePair.indexOf('='); - webResourceBuilder.header(singlePair.substring(0, equalPosition), singlePair.substring(equalPosition + 1, singlePair.length())); + webResourceBuilder.header(singlePair.substring(0, equalPosition), + singlePair.substring(equalPosition + 1, singlePair.length())); } } webResourceBuilder.header("X-ECOMP-RequestID",org.slf4j.MDC.get("X-ECOMP-RequestID")); - ClientResponse response = webResourceBuilder.method(p.httpMethod.toString(), ClientResponse.class, request); - - r.code = response.getStatus(); - r.headers = response.getHeaders(); - EntityTag etag = response.getEntityTag(); - if (etag != null) - r.message = etag.getValue(); - if (response.hasEntity() && r.code != 204) - r.body = response.getEntity(String.class); - } - - long t2 = System.currentTimeMillis(); - log.info("Response received. Time: " + (t2 - t1)); - log.info("HTTP response code: " + r.code); - log.info("HTTP response message: " + r.message); - logHeaders(r.headers); - log.info("HTTP response: " + r.body); - - return r; - } - - protected SSLContext createSSLContext(Parameters p) { - try { - System.setProperty("jsse.enableSNIExtension", "false"); - System.setProperty("javax.net.ssl.trustStore", p.trustStoreFileName); - System.setProperty("javax.net.ssl.trustStorePassword", p.trustStorePassword); - - HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { - - @Override - public boolean verify(String string, SSLSession ssls) { - return true; - } - }); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); - FileInputStream in = new FileInputStream(p.keyStoreFileName); - KeyStore ks = KeyStore.getInstance("PKCS12"); - char[] pwd = p.keyStorePassword.toCharArray(); - ks.load(in, pwd); - kmf.init(ks, pwd); - - SSLContext ctx = SSLContext.getInstance("TLS"); - ctx.init(kmf.getKeyManagers(), null, null); - return ctx; - } catch (Exception e) { - log.error("Error creating SSLContext: " + e.getMessage(), e); - } - return null; - } - - protected void setFailureResponseStatus(SvcLogicContext ctx, String prefix, String errorMessage, HttpResponse r) { - r = new HttpResponse(); - r.code = 500; - r.message = errorMessage; - String pp = prefix != null ? prefix + '.' : ""; - ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); - ctx.setAttribute(pp + "response-message", r.message); - } - - protected void setResponseStatus(SvcLogicContext ctx, String prefix, HttpResponse r) { - String pp = prefix != null ? prefix + '.' : ""; - ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); - ctx.setAttribute(pp + "response-message", r.message); - } - - public void sendFile(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - HttpResponse r = null; - try { - FileParam p = getFileParameters(paramMap); - byte[] data = Files.readAllBytes(Paths.get(p.fileName)); - - r = sendHttpData(data, p); - setResponseStatus(ctx, p.responsePrefix, r); - - } catch (Exception e) { - log.error("Error sending the request: " + e.getMessage(), e); - - r = new HttpResponse(); - r.code = 500; - r.message = e.getMessage(); - String prefix = parseParam(paramMap, "responsePrefix", false, null); - setResponseStatus(ctx, prefix, r); - } - - if (r != null && r.code >= 300) - throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); - } - - private static class FileParam { - - public String fileName; - public String url; - public String user; - public String password; - public HttpMethod httpMethod; - public String responsePrefix; - public boolean skipSending; - } - - private FileParam getFileParameters(Map paramMap) throws SvcLogicException { - FileParam p = new FileParam(); - p.fileName = parseParam(paramMap, "fileName", true, null); - p.url = parseParam(paramMap, "url", true, null); - p.user = parseParam(paramMap, "user", false, null); - p.password = parseParam(paramMap, "password", false, null); - p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); - p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); - String skipSendingStr = paramMap.get("skipSending"); - p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); - return p; - } - - protected HttpResponse sendHttpData(byte[] data, FileParam p) { - Client client = Client.create(); - client.setConnectTimeout(5000); - client.setFollowRedirects(true); - if (p.user != null) - client.addFilter(new HTTPBasicAuthFilter(p.user, p.password)); - WebResource webResource = client.resource(p.url); - - log.info("Sending file"); - long t1 = System.currentTimeMillis(); - - HttpResponse r = new HttpResponse(); - r.code = 200; - - if (!p.skipSending) { - String tt = "application/octet-stream"; - - ClientResponse response = null; - if (p.httpMethod == HttpMethod.POST) - response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); - else if (p.httpMethod == HttpMethod.PUT) - response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); - - r.code = response.getStatus(); - r.headers = response.getHeaders(); - EntityTag etag = response.getEntityTag(); - if (etag != null) - r.message = etag.getValue(); - if (response.hasEntity() && r.code != 204) - r.body = response.getEntity(String.class); - - if (r.code == 301) { - String newUrl = response.getHeaders().getFirst("Location"); - - log.info("Got response code 301. Sending same request to URL: " + newUrl); - - webResource = client.resource(newUrl); - - if (p.httpMethod == HttpMethod.POST) - response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); - else if (p.httpMethod == HttpMethod.PUT) - response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); - - r.code = response.getStatus(); - etag = response.getEntityTag(); - if (etag != null) - r.message = etag.getValue(); - if (response.hasEntity() && r.code != 204) - r.body = response.getEntity(String.class); - } - } - - long t2 = System.currentTimeMillis(); - log.info("Response received. Time: " + (t2 - t1)); - log.info("HTTP response code: " + r.code); - log.info("HTTP response message: " + r.message); - logHeaders(r.headers); - log.info("HTTP response: " + r.body); - - return r; - } - - public void postMessageOnUeb(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - HttpResponse r = null; - try { - UebParam p = getUebParameters(paramMap); - - String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; - - String req = null; - - if (p.templateFileName == null) { - log.info("No template file name specified. Using default UEB template: " + defaultUebTemplateFileName); - p.templateFileName = defaultUebTemplateFileName; - } - - String reqTemplate = readFile(p.templateFileName); - reqTemplate = reqTemplate.replaceAll("rootVarName", p.rootVarName); - req = buildXmlJsonRequest(ctx, reqTemplate, Format.JSON); - - r = postOnUeb(req, p); - setResponseStatus(ctx, p.responsePrefix, r); - if (r.body != null) - ctx.setAttribute(pp + "httpResponse", r.body); - - } catch (Exception e) { - log.error("Error sending the request: " + e.getMessage(), e); - - r = new HttpResponse(); - r.code = 500; - r.message = e.getMessage(); - String prefix = parseParam(paramMap, "responsePrefix", false, null); - setResponseStatus(ctx, prefix, r); - } - - if (r != null && r.code >= 300) - throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); - } - - private static class UebParam { - - public String topic; - public String templateFileName; - public String rootVarName; - public String responsePrefix; - public boolean skipSending; - } - - private UebParam getUebParameters(Map paramMap) throws SvcLogicException { - UebParam p = new UebParam(); - p.topic = parseParam(paramMap, "topic", true, null); - p.templateFileName = parseParam(paramMap, "templateFileName", false, null); - p.rootVarName = parseParam(paramMap, "rootVarName", false, null); - p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); - String skipSendingStr = paramMap.get("skipSending"); - p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); - return p; - } - - protected HttpResponse postOnUeb(String request, UebParam p) throws Exception { - String[] urls = uebServers.split(" "); - for (int i = 0; i < urls.length; i++) { - if (!urls[i].endsWith("/")) - urls[i] += "/"; - urls[i] += "events/" + p.topic; - } - - Client client = Client.create(); - client.setConnectTimeout(5000); - WebResource webResource = client.resource(urls[0]); - - log.info("UEB URL: " + urls[0]); - log.info("Sending request:"); - log.info(request); - long t1 = System.currentTimeMillis(); - - HttpResponse r = new HttpResponse(); - r.code = 200; - - if (!p.skipSending) { - String tt = "application/json"; - String tt1 = tt + ";charset=UTF-8"; - - ClientResponse response = webResource.accept(tt).type(tt1).post(ClientResponse.class, request); - - r.code = response.getStatus(); - r.headers = response.getHeaders(); - if (response.hasEntity()) - r.body = response.getEntity(String.class); - } - - long t2 = System.currentTimeMillis(); - log.info("Response received. Time: " + (t2 - t1)); - log.info("HTTP response code: " + r.code); - logHeaders(r.headers); - log.info("HTTP response:\n" + r.body); - - return r; - } - - protected void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - log.info("Properties:"); - for (String name : ll) - log.info("--- " + name + ": " + String.valueOf(mm.get(name))); - } - - protected void logHeaders(MultivaluedMap mm) { - log.info("HTTP response headers:"); - - if (mm == null) - return; - - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - for (String name : ll) - log.info("--- " + name + ": " + String.valueOf(mm.get(name))); - } - - public void setUebServers(String uebServers) { - this.uebServers = uebServers; - } - - public void setDefaultUebTemplateFileName(String defaultUebTemplateFileName) { - this.defaultUebTemplateFileName = defaultUebTemplateFileName; - } + ClientResponse response = webResourceBuilder.method(p.httpMethod.toString(), ClientResponse.class, request); + + r.code = response.getStatus(); + r.headers = response.getHeaders(); + EntityTag etag = response.getEntityTag(); + if (etag != null) + r.message = etag.getValue(); + if (response.hasEntity() && r.code != 204) + r.body = response.getEntity(String.class); + } + + long t2 = System.currentTimeMillis(); + log.info("Response received. Time: " + (t2 - t1)); + log.info("HTTP response code: " + r.code); + log.info("HTTP response message: " + r.message); + logHeaders(r.headers); + log.info("HTTP response: " + r.body); + + return r; + } + + protected SSLContext createSSLContext(Parameters p) { + try { + System.setProperty("jsse.enableSNIExtension", "false"); + System.setProperty("javax.net.ssl.trustStore", p.trustStoreFileName); + System.setProperty("javax.net.ssl.trustStorePassword", p.trustStorePassword); + + HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { + + @Override + public boolean verify(String string, SSLSession ssls) { + return true; + } + }); + + KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + FileInputStream in = new FileInputStream(p.keyStoreFileName); + KeyStore ks = KeyStore.getInstance("PKCS12"); + char[] pwd = p.keyStorePassword.toCharArray(); + ks.load(in, pwd); + kmf.init(ks, pwd); + + SSLContext ctx = SSLContext.getInstance("TLS"); + ctx.init(kmf.getKeyManagers(), null, null); + return ctx; + } catch (Exception e) { + log.error("Error creating SSLContext: " + e.getMessage(), e); + } + return null; + } + + protected void setFailureResponseStatus(SvcLogicContext ctx, String prefix, String errorMessage, HttpResponse r) { + r = new HttpResponse(); + r.code = 500; + r.message = errorMessage; + String pp = prefix != null ? prefix + '.' : ""; + ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); + ctx.setAttribute(pp + "response-message", r.message); + } + + protected void setResponseStatus(SvcLogicContext ctx, String prefix, HttpResponse r) { + String pp = prefix != null ? prefix + '.' : ""; + ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); + ctx.setAttribute(pp + "response-message", r.message); + } + + public void sendFile(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + HttpResponse r = null; + try { + FileParam p = getFileParameters(paramMap); + byte[] data = Files.readAllBytes(Paths.get(p.fileName)); + + r = sendHttpData(data, p); + setResponseStatus(ctx, p.responsePrefix, r); + + } catch (Exception e) { + log.error("Error sending the request: " + e.getMessage(), e); + + r = new HttpResponse(); + r.code = 500; + r.message = e.getMessage(); + String prefix = parseParam(paramMap, "responsePrefix", false, null); + setResponseStatus(ctx, prefix, r); + } + + if (r != null && r.code >= 300) + throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); + } + + private static class FileParam { + + public String fileName; + public String url; + public String user; + public String password; + public HttpMethod httpMethod; + public String responsePrefix; + public boolean skipSending; + } + + private FileParam getFileParameters(Map paramMap) throws SvcLogicException { + FileParam p = new FileParam(); + p.fileName = parseParam(paramMap, "fileName", true, null); + p.url = parseParam(paramMap, "url", true, null); + p.user = parseParam(paramMap, "user", false, null); + p.password = parseParam(paramMap, "password", false, null); + p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); + p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + String skipSendingStr = paramMap.get("skipSending"); + p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + return p; + } + + protected HttpResponse sendHttpData(byte[] data, FileParam p) { + Client client = Client.create(); + client.setConnectTimeout(5000); + client.setFollowRedirects(true); + if (p.user != null) + client.addFilter(new HTTPBasicAuthFilter(p.user, p.password)); + WebResource webResource = client.resource(p.url); + + log.info("Sending file"); + long t1 = System.currentTimeMillis(); + + HttpResponse r = new HttpResponse(); + r.code = 200; + + if (!p.skipSending) { + String tt = "application/octet-stream"; + + ClientResponse response = null; + if (p.httpMethod == HttpMethod.POST) + response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); + else if (p.httpMethod == HttpMethod.PUT) + response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); + + r.code = response.getStatus(); + r.headers = response.getHeaders(); + EntityTag etag = response.getEntityTag(); + if (etag != null) + r.message = etag.getValue(); + if (response.hasEntity() && r.code != 204) + r.body = response.getEntity(String.class); + + if (r.code == 301) { + String newUrl = response.getHeaders().getFirst("Location"); + + log.info("Got response code 301. Sending same request to URL: " + newUrl); + + webResource = client.resource(newUrl); + + if (p.httpMethod == HttpMethod.POST) + response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); + else if (p.httpMethod == HttpMethod.PUT) + response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); + + r.code = response.getStatus(); + etag = response.getEntityTag(); + if (etag != null) + r.message = etag.getValue(); + if (response.hasEntity() && r.code != 204) + r.body = response.getEntity(String.class); + } + } + + long t2 = System.currentTimeMillis(); + log.info("Response received. Time: " + (t2 - t1)); + log.info("HTTP response code: " + r.code); + log.info("HTTP response message: " + r.message); + logHeaders(r.headers); + log.info("HTTP response: " + r.body); + + return r; + } + + public void postMessageOnUeb(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + HttpResponse r = null; + try { + UebParam p = getUebParameters(paramMap); + + String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; + + String req = null; + + if (p.templateFileName == null) { + log.info("No template file name specified. Using default UEB template: " + defaultUebTemplateFileName); + p.templateFileName = defaultUebTemplateFileName; + } + + String reqTemplate = readFile(p.templateFileName); + reqTemplate = reqTemplate.replaceAll("rootVarName", p.rootVarName); + req = buildXmlJsonRequest(ctx, reqTemplate, Format.JSON); + + r = postOnUeb(req, p); + setResponseStatus(ctx, p.responsePrefix, r); + if (r.body != null) + ctx.setAttribute(pp + "httpResponse", r.body); + + } catch (Exception e) { + log.error("Error sending the request: " + e.getMessage(), e); + + r = new HttpResponse(); + r.code = 500; + r.message = e.getMessage(); + String prefix = parseParam(paramMap, "responsePrefix", false, null); + setResponseStatus(ctx, prefix, r); + } + + if (r != null && r.code >= 300) + throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); + } + + private static class UebParam { + + public String topic; + public String templateFileName; + public String rootVarName; + public String responsePrefix; + public boolean skipSending; + } + + private UebParam getUebParameters(Map paramMap) throws SvcLogicException { + UebParam p = new UebParam(); + p.topic = parseParam(paramMap, "topic", true, null); + p.templateFileName = parseParam(paramMap, "templateFileName", false, null); + p.rootVarName = parseParam(paramMap, "rootVarName", false, null); + p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + String skipSendingStr = paramMap.get("skipSending"); + p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + return p; + } + + protected HttpResponse postOnUeb(String request, UebParam p) throws Exception { + String[] urls = uebServers.split(" "); + for (int i = 0; i < urls.length; i++) { + if (!urls[i].endsWith("/")) + urls[i] += "/"; + urls[i] += "events/" + p.topic; + } + + Client client = Client.create(); + client.setConnectTimeout(5000); + WebResource webResource = client.resource(urls[0]); + + log.info("UEB URL: " + urls[0]); + log.info("Sending request:"); + log.info(request); + long t1 = System.currentTimeMillis(); + + HttpResponse r = new HttpResponse(); + r.code = 200; + + if (!p.skipSending) { + String tt = "application/json"; + String tt1 = tt + ";charset=UTF-8"; + + ClientResponse response = webResource.accept(tt).type(tt1).post(ClientResponse.class, request); + + r.code = response.getStatus(); + r.headers = response.getHeaders(); + if (response.hasEntity()) + r.body = response.getEntity(String.class); + } + + long t2 = System.currentTimeMillis(); + log.info("Response received. Time: " + (t2 - t1)); + log.info("HTTP response code: " + r.code); + logHeaders(r.headers); + log.info("HTTP response:\n" + r.body); + + return r; + } + + protected void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + String.valueOf(mm.get(name))); + } + + protected void logHeaders(MultivaluedMap mm) { + log.info("HTTP response headers:"); + + if (mm == null) + return; + + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + for (String name : ll) + log.info("--- " + name + ": " + String.valueOf(mm.get(name))); + } + + public void setUebServers(String uebServers) { + this.uebServers = uebServers; + } + + public void setDefaultUebTemplateFileName(String defaultUebTemplateFileName) { + this.defaultUebTemplateFileName = defaultUebTemplateFileName; + } } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java index 69334a969..5cee07791 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java @@ -40,7 +40,8 @@ public class RetryPolicy { } if(position == null){ - throw new RetryException("No match found for the provided uri[" + uri + "] so the next host name could not be retreived"); + throw new RetryException("No match found for the provided uri[" + uri + "] " + + "so the next host name could not be retreived"); } position++; diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java index 2fa3fa541..16b9f519f 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -31,342 +31,342 @@ import org.slf4j.LoggerFactory; public class XmlJsonUtil { - private static final Logger log = LoggerFactory.getLogger(XmlJsonUtil.class); - - public static String getXml(Map varmap, String var) { - boolean escape = true; - if (var.startsWith("'")) { - var = var.substring(1); - escape = false; - } - - Object o = createStructure(varmap, var); - return generateXml(o, 0, escape); - } - - public static String getJson(Map varmap, String var) { - boolean escape = true; - if (var.startsWith("'")) { - var = var.substring(1); - escape = false; - } - - Object o = createStructure(varmap, var); - return generateJson(o, escape); - } - - private static Object createStructure(Map flatmap, String var) { - if (flatmap.containsKey(var)) { - if (var.endsWith("_length") || var.endsWith("].key")) - return null; - return flatmap.get(var); - } - - Map mm = new HashMap<>(); - for (String k : flatmap.keySet()) - if (k.startsWith(var + ".")) { - int i1 = k.indexOf('.', var.length() + 1); - int i2 = k.indexOf('[', var.length() + 1); - int i3 = k.length(); - if (i1 > 0 && i1 < i3) - i3 = i1; - if (i2 > 0 && i2 < i3) - i3 = i2; - String k1 = k.substring(var.length() + 1, i3); - String var1 = k.substring(0, i3); - if (!mm.containsKey(k1)) { - Object str = createStructure(flatmap, var1); - if (str != null && (!(str instanceof String) || ((String) str).trim().length() > 0)) - mm.put(k1, str); - } - } - if (!mm.isEmpty()) - return mm; - - boolean arrayFound = false; - for (String k : flatmap.keySet()) - if (k.startsWith(var + "[")) { - arrayFound = true; - break; - } - - if (arrayFound) { - List ll = new ArrayList<>(); - - int length = Integer.MAX_VALUE; - String lengthStr = flatmap.get(var + "_length"); - if (lengthStr != null) { - try { - length = Integer.parseInt(lengthStr); - } catch (Exception e) { - log.warn("Invalid number for " + var + "_length:" + lengthStr); - } - } - - for (int i = 0; i < length; i++) { - Object v = createStructure(flatmap, var + '[' + i + ']'); - if (v == null) - break; - ll.add(v); - } - - if (!ll.isEmpty()) - return ll; - } - - return null; - } - - @SuppressWarnings("unchecked") - private static String generateXml(Object o, int indent, boolean escape) { - if (o == null) - return null; - - if (o instanceof String) - return escape ? escapeXml((String) o) : (String) o;; - - if (o instanceof Map) { - StringBuilder ss = new StringBuilder(); - Map mm = (Map) o; - for (String k : mm.keySet()) { - Object v = mm.get(k); - if (v instanceof String) { - String s = escape ? escapeXml((String) v) : (String) v; - ss.append(pad(indent)).append('<').append(k).append('>'); - ss.append(s); - ss.append("').append('\n'); - } else if (v instanceof Map) { - ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); - ss.append(generateXml(v, indent + 1, escape)); - ss.append(pad(indent)).append("').append('\n'); - } else if (v instanceof List) { - List ll = (List) v; - for (Object o1 : ll) { - ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); - ss.append(generateXml(o1, indent + 1, escape)); - ss.append(pad(indent)).append("').append('\n'); - } - } - } - return ss.toString(); - } - - return null; - } - - private static String generateJson(Object o, boolean escape) { - if (o == null) - return null; - - StringBuilder ss = new StringBuilder(); - generateJson(ss, o, 0, false, escape); - return ss.toString(); - } - - @SuppressWarnings("unchecked") - private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape) { - if (o instanceof String) { - String s = escape ? escapeJson((String) o) : (String) o; - if (padFirst) - ss.append(pad(indent)); - ss.append('"').append(s).append('"'); - return; - } - - if (o instanceof Map) { - Map mm = (Map) o; - - if (padFirst) - ss.append(pad(indent)); - ss.append("{\n"); - - boolean first = true; - for (String k : mm.keySet()) { - if (!first) - ss.append(",\n"); - first = false; - - Object v = mm.get(k); - ss.append(pad(indent + 1)).append('"').append(k).append("\": "); - generateJson(ss, v, indent + 1, false, escape); - } - - ss.append("\n"); - ss.append(pad(indent)).append('}'); - - return; - } - - if (o instanceof List) { - List ll = (List) o; - - if (padFirst) - ss.append(pad(indent)); - ss.append("[\n"); - - boolean first = true; - for (Object o1 : ll) { - if (!first) - ss.append(",\n"); - first = false; - - generateJson(ss, o1, indent + 1, true, escape); - } - - ss.append("\n"); - ss.append(pad(indent)).append(']'); - } - } - - public static String removeLastCommaJson(String s) { - StringBuilder sb = new StringBuilder(); - int k = 0; - int start = 0; - while (k < s.length()) { - int i11 = s.indexOf('}', k); - int i12 = s.indexOf(']', k); - int i1 = -1; - if (i11 < 0) - i1 = i12; - else if (i12 < 0) - i1 = i11; - else - i1 = i11 < i12 ? i11 : i12; - if (i1 < 0) - break; - - int i2 = s.lastIndexOf(',', i1); - if (i2 < 0) { - k = i1 + 1; - continue; - } - - String between = s.substring(i2 + 1, i1); - if (between.trim().length() > 0) { - k = i1 + 1; - continue; - } - - sb.append(s.substring(start, i2)); - start = i2 + 1; - k = i1 + 1; - } - - sb.append(s.substring(start, s.length())); - - return sb.toString(); - } - - public static String removeEmptyStructJson(String s) { - int k = 0; - while (k < s.length()) { - boolean curly = true; - int i11 = s.indexOf('{', k); - int i12 = s.indexOf('[', k); - int i1 = -1; - if (i11 < 0) { - i1 = i12; - curly = false; - } else if (i12 < 0) - i1 = i11; - else - if (i11 < i12) - i1 = i11; - else { - i1 = i12; - curly = false; - } - - if (i1 >= 0) { - int i2 = curly ? s.indexOf('}', i1) : s.indexOf(']', i1); - if (i2 > 0) { - String value = s.substring(i1 + 1, i2); - if (value.trim().length() == 0) { - int i4 = s.lastIndexOf('\n', i1); - if (i4 < 0) - i4 = 0; - int i5 = s.indexOf('\n', i2); - if (i5 < 0) - i5 = s.length(); - - s = s.substring(0, i4) + s.substring(i5); - k = 0; - } else - k = i1 + 1; - } else - break; - } else - break; - } - - return s; - } - - public static String removeEmptyStructXml(String s) { - int k = 0; - while (k < s.length()) { - int i1 = s.indexOf('<', k); - if (i1 < 0 || i1 == s.length() - 1) - break; - - char c1 = s.charAt(i1 + 1); - if (c1 == '?' || c1 == '!') { - k = i1 + 2; - continue; - } - - int i2 = s.indexOf('>', i1); - if (i2 < 0) { - k = i1 + 1; - continue; - } - - String closingTag = " 0) { - k = i2 + 1; - continue; - } - - int i4 = s.lastIndexOf('\n', i1); - if (i4 < 0) - i4 = 0; - int i5 = s.indexOf('\n', i3); - if (i5 < 0) - i5 = s.length(); - - s = s.substring(0, i4) + s.substring(i5); - k = 0; - } - - return s; - } - - private static String escapeXml(String v) { - String s = v.replaceAll("&", "&"); - s = s.replaceAll("<", "<"); - s = s.replaceAll("'", "'"); - s = s.replaceAll("\"", """); - s = s.replaceAll(">", ">"); - return s; - } - - private static String escapeJson(String v) { - String s = v.replaceAll("\\\\", "\\\\\\\\"); - s = s.replaceAll("\"", "\\\\\""); - return s; - } - - private static String pad(int n) { - String s = ""; - for (int i = 0; i < n; i++) - s += '\t'; - return s; - } + private static final Logger log = LoggerFactory.getLogger(XmlJsonUtil.class); + + public static String getXml(Map varmap, String var) { + boolean escape = true; + if (var.startsWith("'")) { + var = var.substring(1); + escape = false; + } + + Object o = createStructure(varmap, var); + return generateXml(o, 0, escape); + } + + public static String getJson(Map varmap, String var) { + boolean escape = true; + if (var.startsWith("'")) { + var = var.substring(1); + escape = false; + } + + Object o = createStructure(varmap, var); + return generateJson(o, escape); + } + + private static Object createStructure(Map flatmap, String var) { + if (flatmap.containsKey(var)) { + if (var.endsWith("_length") || var.endsWith("].key")) + return null; + return flatmap.get(var); + } + + Map mm = new HashMap<>(); + for (String k : flatmap.keySet()) + if (k.startsWith(var + ".")) { + int i1 = k.indexOf('.', var.length() + 1); + int i2 = k.indexOf('[', var.length() + 1); + int i3 = k.length(); + if (i1 > 0 && i1 < i3) + i3 = i1; + if (i2 > 0 && i2 < i3) + i3 = i2; + String k1 = k.substring(var.length() + 1, i3); + String var1 = k.substring(0, i3); + if (!mm.containsKey(k1)) { + Object str = createStructure(flatmap, var1); + if (str != null && (!(str instanceof String) || ((String) str).trim().length() > 0)) + mm.put(k1, str); + } + } + if (!mm.isEmpty()) + return mm; + + boolean arrayFound = false; + for (String k : flatmap.keySet()) + if (k.startsWith(var + "[")) { + arrayFound = true; + break; + } + + if (arrayFound) { + List ll = new ArrayList<>(); + + int length = Integer.MAX_VALUE; + String lengthStr = flatmap.get(var + "_length"); + if (lengthStr != null) { + try { + length = Integer.parseInt(lengthStr); + } catch (Exception e) { + log.warn("Invalid number for " + var + "_length:" + lengthStr); + } + } + + for (int i = 0; i < length; i++) { + Object v = createStructure(flatmap, var + '[' + i + ']'); + if (v == null) + break; + ll.add(v); + } + + if (!ll.isEmpty()) + return ll; + } + + return null; + } + + @SuppressWarnings("unchecked") + private static String generateXml(Object o, int indent, boolean escape) { + if (o == null) + return null; + + if (o instanceof String) + return escape ? escapeXml((String) o) : (String) o;; + + if (o instanceof Map) { + StringBuilder ss = new StringBuilder(); + Map mm = (Map) o; + for (String k : mm.keySet()) { + Object v = mm.get(k); + if (v instanceof String) { + String s = escape ? escapeXml((String) v) : (String) v; + ss.append(pad(indent)).append('<').append(k).append('>'); + ss.append(s); + ss.append("').append('\n'); + } else if (v instanceof Map) { + ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); + ss.append(generateXml(v, indent + 1, escape)); + ss.append(pad(indent)).append("').append('\n'); + } else if (v instanceof List) { + List ll = (List) v; + for (Object o1 : ll) { + ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); + ss.append(generateXml(o1, indent + 1, escape)); + ss.append(pad(indent)).append("').append('\n'); + } + } + } + return ss.toString(); + } + + return null; + } + + private static String generateJson(Object o, boolean escape) { + if (o == null) + return null; + + StringBuilder ss = new StringBuilder(); + generateJson(ss, o, 0, false, escape); + return ss.toString(); + } + + @SuppressWarnings("unchecked") + private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape) { + if (o instanceof String) { + String s = escape ? escapeJson((String) o) : (String) o; + if (padFirst) + ss.append(pad(indent)); + ss.append('"').append(s).append('"'); + return; + } + + if (o instanceof Map) { + Map mm = (Map) o; + + if (padFirst) + ss.append(pad(indent)); + ss.append("{\n"); + + boolean first = true; + for (String k : mm.keySet()) { + if (!first) + ss.append(",\n"); + first = false; + + Object v = mm.get(k); + ss.append(pad(indent + 1)).append('"').append(k).append("\": "); + generateJson(ss, v, indent + 1, false, escape); + } + + ss.append("\n"); + ss.append(pad(indent)).append('}'); + + return; + } + + if (o instanceof List) { + List ll = (List) o; + + if (padFirst) + ss.append(pad(indent)); + ss.append("[\n"); + + boolean first = true; + for (Object o1 : ll) { + if (!first) + ss.append(",\n"); + first = false; + + generateJson(ss, o1, indent + 1, true, escape); + } + + ss.append("\n"); + ss.append(pad(indent)).append(']'); + } + } + + public static String removeLastCommaJson(String s) { + StringBuilder sb = new StringBuilder(); + int k = 0; + int start = 0; + while (k < s.length()) { + int i11 = s.indexOf('}', k); + int i12 = s.indexOf(']', k); + int i1 = -1; + if (i11 < 0) + i1 = i12; + else if (i12 < 0) + i1 = i11; + else + i1 = i11 < i12 ? i11 : i12; + if (i1 < 0) + break; + + int i2 = s.lastIndexOf(',', i1); + if (i2 < 0) { + k = i1 + 1; + continue; + } + + String between = s.substring(i2 + 1, i1); + if (between.trim().length() > 0) { + k = i1 + 1; + continue; + } + + sb.append(s.substring(start, i2)); + start = i2 + 1; + k = i1 + 1; + } + + sb.append(s.substring(start, s.length())); + + return sb.toString(); + } + + public static String removeEmptyStructJson(String s) { + int k = 0; + while (k < s.length()) { + boolean curly = true; + int i11 = s.indexOf('{', k); + int i12 = s.indexOf('[', k); + int i1 = -1; + if (i11 < 0) { + i1 = i12; + curly = false; + } else if (i12 < 0) + i1 = i11; + else + if (i11 < i12) + i1 = i11; + else { + i1 = i12; + curly = false; + } + + if (i1 >= 0) { + int i2 = curly ? s.indexOf('}', i1) : s.indexOf(']', i1); + if (i2 > 0) { + String value = s.substring(i1 + 1, i2); + if (value.trim().length() == 0) { + int i4 = s.lastIndexOf('\n', i1); + if (i4 < 0) + i4 = 0; + int i5 = s.indexOf('\n', i2); + if (i5 < 0) + i5 = s.length(); + + s = s.substring(0, i4) + s.substring(i5); + k = 0; + } else + k = i1 + 1; + } else + break; + } else + break; + } + + return s; + } + + public static String removeEmptyStructXml(String s) { + int k = 0; + while (k < s.length()) { + int i1 = s.indexOf('<', k); + if (i1 < 0 || i1 == s.length() - 1) + break; + + char c1 = s.charAt(i1 + 1); + if (c1 == '?' || c1 == '!') { + k = i1 + 2; + continue; + } + + int i2 = s.indexOf('>', i1); + if (i2 < 0) { + k = i1 + 1; + continue; + } + + String closingTag = " 0) { + k = i2 + 1; + continue; + } + + int i4 = s.lastIndexOf('\n', i1); + if (i4 < 0) + i4 = 0; + int i5 = s.indexOf('\n', i3); + if (i5 < 0) + i5 = s.length(); + + s = s.substring(0, i4) + s.substring(i5); + k = 0; + } + + return s; + } + + private static String escapeXml(String v) { + String s = v.replaceAll("&", "&"); + s = s.replaceAll("<", "<"); + s = s.replaceAll("'", "'"); + s = s.replaceAll("\"", """); + s = s.replaceAll(">", ">"); + return s; + } + + private static String escapeJson(String v) { + String s = v.replaceAll("\\\\", "\\\\\\\\"); + s = s.replaceAll("\"", "\\\\\""); + return s; + } + + private static String pad(int n) { + String s = ""; + for (int i = 0; i < n; i++) + s += '\t'; + return s; + } } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java index 8f3febcaf..85c9dc018 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java @@ -39,122 +39,122 @@ import org.xml.sax.helpers.DefaultHandler; public class XmlParser { - private static final Logger log = LoggerFactory.getLogger(XmlParser.class); - - public static Map convertToProperties(String s, Set listNameList) { - Handler handler = new Handler(listNameList); - try { - SAXParserFactory factory = SAXParserFactory.newInstance(); - SAXParser saxParser = factory.newSAXParser(); - InputStream in = new ByteArrayInputStream(s.getBytes()); - saxParser.parse(in, handler); - } catch (Exception e) { - e.printStackTrace(); - } - - return handler.getProperties(); - } - - private static class Handler extends DefaultHandler { - - private Set listNameList; - - private Map properties = new HashMap<>(); - - public Map getProperties() { - return properties; - } - - public Handler(Set listNameList) { - super(); - this.listNameList = listNameList; - if (this.listNameList == null) - this.listNameList = new HashSet(); - } - - String currentName = ""; - String currentValue = ""; - - @Override - public void startElement(String uri, String localName, String qName, Attributes attributes) - throws SAXException { - super.startElement(uri, localName, qName, attributes); - - String name = localName; - if (name == null || name.trim().length() == 0) - name = qName; - int i2 = name.indexOf(':'); - if (i2 >= 0) - name = name.substring(i2 + 1); - - if (currentName.length() > 0) - currentName += '.'; - currentName += name; - - String listName = removeIndexes(currentName); - - if (listNameList.contains(listName)) { - int len = getInt(properties, currentName + "_length"); - properties.put(currentName + "_length", String.valueOf(len + 1)); - currentName += "[" + len + "]"; - } - } - - @Override - public void endElement(String uri, String localName, String qName) throws SAXException { - super.endElement(uri, localName, qName); - - String name = localName; - if (name == null || name.trim().length() == 0) - name = qName; - int i2 = name.indexOf(':'); - if (i2 >= 0) - name = name.substring(i2 + 1); - - if (currentValue.trim().length() > 0) { - currentValue = currentValue.trim(); - properties.put(currentName, currentValue); - - log.info("Added property: " + currentName + ": " + currentValue); - - currentValue = ""; - } - - int i1 = currentName.lastIndexOf("." + name); - if (i1 <= 0) - currentName = ""; - else - currentName = currentName.substring(0, i1); - } - - @Override - public void characters(char[] ch, int start, int length) throws SAXException { - super.characters(ch, start, length); - - String value = new String(ch, start, length); - currentValue += value; - } - - private static int getInt(Map mm, String name) { - String s = mm.get(name); - if (s == null) - return 0; - return Integer.parseInt(s); - } - - private String removeIndexes(String currentName) { - String s = ""; - boolean add = true; - for (int i = 0; i < currentName.length(); i++) { - char c = currentName.charAt(i); - if (c == '[') - add = false; - else if (c == ']') - add = true; - else if (add) - s += c; - } - return s; - } - } + private static final Logger log = LoggerFactory.getLogger(XmlParser.class); + + public static Map convertToProperties(String s, Set listNameList) { + Handler handler = new Handler(listNameList); + try { + SAXParserFactory factory = SAXParserFactory.newInstance(); + SAXParser saxParser = factory.newSAXParser(); + InputStream in = new ByteArrayInputStream(s.getBytes()); + saxParser.parse(in, handler); + } catch (Exception e) { + e.printStackTrace(); + } + + return handler.getProperties(); + } + + private static class Handler extends DefaultHandler { + + private Set listNameList; + + private Map properties = new HashMap<>(); + + public Map getProperties() { + return properties; + } + + public Handler(Set listNameList) { + super(); + this.listNameList = listNameList; + if (this.listNameList == null) + this.listNameList = new HashSet(); + } + + String currentName = ""; + String currentValue = ""; + + @Override + public void startElement(String uri, String localName, String qName, Attributes attributes) + throws SAXException { + super.startElement(uri, localName, qName, attributes); + + String name = localName; + if (name == null || name.trim().length() == 0) + name = qName; + int i2 = name.indexOf(':'); + if (i2 >= 0) + name = name.substring(i2 + 1); + + if (currentName.length() > 0) + currentName += '.'; + currentName += name; + + String listName = removeIndexes(currentName); + + if (listNameList.contains(listName)) { + int len = getInt(properties, currentName + "_length"); + properties.put(currentName + "_length", String.valueOf(len + 1)); + currentName += "[" + len + "]"; + } + } + + @Override + public void endElement(String uri, String localName, String qName) throws SAXException { + super.endElement(uri, localName, qName); + + String name = localName; + if (name == null || name.trim().length() == 0) + name = qName; + int i2 = name.indexOf(':'); + if (i2 >= 0) + name = name.substring(i2 + 1); + + if (currentValue.trim().length() > 0) { + currentValue = currentValue.trim(); + properties.put(currentName, currentValue); + + log.info("Added property: " + currentName + ": " + currentValue); + + currentValue = ""; + } + + int i1 = currentName.lastIndexOf("." + name); + if (i1 <= 0) + currentName = ""; + else + currentName = currentName.substring(0, i1); + } + + @Override + public void characters(char[] ch, int start, int length) throws SAXException { + super.characters(ch, start, length); + + String value = new String(ch, start, length); + currentValue += value; + } + + private static int getInt(Map mm, String name) { + String s = mm.get(name); + if (s == null) + return 0; + return Integer.parseInt(s); + } + + private String removeIndexes(String currentName) { + String s = ""; + boolean add = true; + for (int i = 0; i < currentName.length(); i++) { + char c = currentName.charAt(i); + if (c == '[') + add = false; + else if (c == ']') + add = true; + else if (add) + s += c; + } + return s; + } + } } diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml index 25ce0120a..87850624c 100644 --- a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml +++ b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml @@ -24,26 +24,26 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - - - + + + file:${SDNC_CONFIG_DIR}/ueb.properties file:${SDNC_CONFIG_DIR}/dme2.properties - - - - + + + + - + - - - - + + + + - - - + + + diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml index 8f34005d5..2f1e4dbde 100644 --- a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml +++ b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml @@ -21,12 +21,12 @@ --> - + diff --git a/restapi-call-node/provider/src/main/resources/default-ueb-message.json b/restapi-call-node/provider/src/main/resources/default-ueb-message.json index 4b1aa0386..6ef6be7f6 100644 --- a/restapi-call-node/provider/src/main/resources/default-ueb-message.json +++ b/restapi-call-node/provider/src/main/resources/default-ueb-message.json @@ -20,13 +20,13 @@ */ { - "event":{ - "header":{ - "eventSource":"sdn-c" - }, - "body": + "event":{ + "header":{ + "eventSource":"sdn-c" + }, + "body": ${rootVarName} - } + } } diff --git a/restapi-call-node/provider/src/main/resources/northbound-api-template.json b/restapi-call-node/provider/src/main/resources/northbound-api-template.json index d48c41ce9..73a61b636 100644 --- a/restapi-call-node/provider/src/main/resources/northbound-api-template.json +++ b/restapi-call-node/provider/src/main/resources/northbound-api-template.json @@ -19,25 +19,25 @@ * ============LICENSE_END========================================================= */ -{ -"input": - { - "sdnc-request-header":{ - "svc-request-id": ${service-topology-operation-input.sdnc-request-header.svc-request-id}, - "svc-notification-url": ${service-topology-operation-input.sdnc-request-header.svc-notification-url} - }, - "request-information":{ - "request-id": ${service-topology-operation-input.request-information.request-id}, - "request-action": ${service-topology-operation-input.request-information.request-action}, - "request-sub-action": ${service-topology-operation-input.request-information.request-sub-action}, - "source": ${service-topology-operation-input.request-information.source}, - "notification-url": ${service-topology-operation-input.request-information.notification-url} - }, - "service-information":{ - "service-type": ${service-topology-operation-input.service-information.service-type}, - "service-instance-id": ${service-topology-operation-input.service-information.service-instance-id}, - "subscriber-name": ${service-topology-operation-input.service-information.subscriber-name}, - "subscriber-global-id": ${service-topology-operation-input.service-information.subscriber-global-id} - } +{ +"input": + { + "sdnc-request-header":{ + "svc-request-id": ${service-topology-operation-input.sdnc-request-header.svc-request-id}, + "svc-notification-url": ${service-topology-operation-input.sdnc-request-header.svc-notification-url} + }, + "request-information":{ + "request-id": ${service-topology-operation-input.request-information.request-id}, + "request-action": ${service-topology-operation-input.request-information.request-action}, + "request-sub-action": ${service-topology-operation-input.request-information.request-sub-action}, + "source": ${service-topology-operation-input.request-information.source}, + "notification-url": ${service-topology-operation-input.request-information.notification-url} + }, + "service-information":{ + "service-type": ${service-topology-operation-input.service-information.service-type}, + "service-instance-id": ${service-topology-operation-input.service-information.service-instance-id}, + "subscriber-name": ${service-topology-operation-input.service-information.subscriber-name}, + "subscriber-global-id": ${service-topology-operation-input.service-information.subscriber-global-id} + } } - + diff --git a/restapi-call-node/provider/src/main/resources/northbound-api-template.xml b/restapi-call-node/provider/src/main/resources/northbound-api-template.xml index 5c2b9ad9a..aea0625c1 100644 --- a/restapi-call-node/provider/src/main/resources/northbound-api-template.xml +++ b/restapi-call-node/provider/src/main/resources/northbound-api-template.xml @@ -37,7 +37,7 @@ ${service-topology-operation-input.service-information.service-type} ${service-topology-operation-input.service-information.subscriber-global-id} ${service-topology-operation-input.service-information.subscriber-name} - + ${'northbound-anyData} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java index 107e8c88e..dbca5ad7b 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java @@ -35,31 +35,33 @@ import org.slf4j.LoggerFactory; public class TestJsonParser { - private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); + private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); - @Test - public void test() throws Exception { - BufferedReader in = new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json"))); - String ss = ""; - String line = null; - while ((line = in.readLine()) != null) - ss += line + '\n'; + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) + ); + String ss = ""; + String line = null; + while ((line = in.readLine()) != null) + ss += line + '\n'; - Map mm = JsonParser.convertToProperties(ss); + Map mm = JsonParser.convertToProperties(ss); - logProperties(mm); + logProperties(mm); - in.close(); - } + in.close(); + } - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); - log.info("Properties:"); - for (String name : ll) - log.info("--- " + name + ": " + mm.get(name)); - } + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } } diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 5b03bff47..ff9714809 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -32,61 +32,61 @@ import org.slf4j.LoggerFactory; public class TestRestapiCallNode { - private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); + private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); - @Test - public void testDelete() throws Exception { - SvcLogicContext ctx = new SvcLogicContext(); + @Test + public void testDelete() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "pwd1"); - p.put("httpMethod", "delete"); - p.put("skipSending", "true"); + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("skipSending", "true"); - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } - @Test - public void testJsonTemplate() throws Exception { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); + @Test + public void testJsonTemplate() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } } diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java index ad1c34e90..579d194d5 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java @@ -40,57 +40,98 @@ public class TestXmlJsonUtil { Map mm = new HashMap<>(); mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); mm.put("service-data.service-information.service-instance-id", "someinstance001"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3_length", "2"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3_length", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf_length", "1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf_length", "1"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", + "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); mm.put("service-data.vnf-config-information.vendor", "Netconf"); - mm.put("service-data.vnf-config-information.escape-test", "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); + mm.put("service-data.vnf-config-information.escape-test", + "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); log.info(ss); diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java index 6d506ccec..544d259e0 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java @@ -37,39 +37,41 @@ import org.slf4j.LoggerFactory; public class TestXmlParser { - private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); + private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); - @Test - public void test() throws Exception { - BufferedReader in = new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml"))); - String ss = ""; - String line = null; - while ((line = in.readLine()) != null) - ss += line + '\n'; + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + String ss = ""; + String line = null; + while ((line = in.readLine()) != null) + ss += line + '\n'; - Set listNameList = new HashSet(); - listNameList.add("project.dependencies.dependency"); - listNameList.add("project.build.plugins.plugin"); - listNameList.add("project.build.plugins.plugin.executions.execution"); - listNameList.add("project.build.pluginManagement.plugins.plugin"); - listNameList.add( - "project.build.pluginManagement.plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); + Set listNameList = new HashSet(); + listNameList.add("project.dependencies.dependency"); + listNameList.add("project.build.plugins.plugin"); + listNameList.add("project.build.plugins.plugin.executions.execution"); + listNameList.add("project.build.pluginManagement.plugins.plugin"); + listNameList.add("project.build.pluginManagement." + + "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); - Map mm = XmlParser.convertToProperties(ss, listNameList); + Map mm = XmlParser.convertToProperties(ss, listNameList); - logProperties(mm); + logProperties(mm); - in.close(); - } + in.close(); + } - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); - log.info("Properties:"); - for (String name : ll) - log.info("--- " + name + ": " + mm.get(name)); - } + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } } diff --git a/restapi-call-node/provider/src/test/resources/test.json b/restapi-call-node/provider/src/test/resources/test.json index 885e66028..a34f7e2a0 100644 --- a/restapi-call-node/provider/src/test/resources/test.json +++ b/restapi-call-node/provider/src/test/resources/test.json @@ -20,29 +20,29 @@ */ { - "equipment-data": [ - { - "server-count": "4", - "max-server-speed": "1600000", - "number-primary-servers": "2", - "equipment-id": "Server1", - "server-model": "Unknown", - "server-id": "Server1" - } - ], - "resource-state": { - "threshold-value": "1600000", - "last-added": "1605000", - "used": "1605000", - "limit-value": "1920000" - }, - "resource-rule": { - "endpoint-position": "VCE-Cust", - "soft-limit-expression": "0.6 * max-server-speed * number-primary-servers", - "resource-name": "Bandwidth", - "service-model": "DUMMY", - "hard-limit-expression": "max-server-speed * number-primary-servers", - "equipment-level": "Server" - }, - "message": "The provisioned access bandwidth is at or exceeds 50% of the total server capacity." + "equipment-data": [ + { + "server-count": "4", + "max-server-speed": "1600000", + "number-primary-servers": "2", + "equipment-id": "Server1", + "server-model": "Unknown", + "server-id": "Server1" + } + ], + "resource-state": { + "threshold-value": "1600000", + "last-added": "1605000", + "used": "1605000", + "limit-value": "1920000" + }, + "resource-rule": { + "endpoint-position": "VCE-Cust", + "soft-limit-expression": "0.6 * max-server-speed * number-primary-servers", + "resource-name": "Bandwidth", + "service-model": "DUMMY", + "hard-limit-expression": "max-server-speed * number-primary-servers", + "equipment-level": "Server" + }, + "message": "The provisioned access bandwidth is at or exceeds 50% of the total server capacity." } diff --git a/restapi-call-node/provider/src/test/resources/test.xml b/restapi-call-node/provider/src/test/resources/test.xml index 391c9b3e0..b60b5356e 100644 --- a/restapi-call-node/provider/src/test/resources/test.xml +++ b/restapi-call-node/provider/src/test/resources/test.xml @@ -21,152 +21,152 @@ --> - 4.0.0 - - org.onap.ccsdk.sli.plugins - restapi-call-node - 6.0.0-SNAPSHOT - - restapi-call-node-provider - bundle - RESTAPI Call Node - Provider - http://maven.apache.org - - UTF-8 - - - - junit - junit - test - - - org.springframework - spring-test - 3.1.4.RELEASE - test - - - org.onap.ccsdk.sli - sli-common - compile - - - org.onap.ccsdk.sli - sli-provider - compile - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - jcl-over-slf4j - ${slf4j.version} - - - org.springframework - spring-beans - 3.1.4.RELEASE - - - org.springframework - spring-context - 3.1.4.RELEASE - - - xerces - xerces - 2.4.0 - provided - - - com.sun.jersey - jersey-client - 1.17 - - - commons-codec - commons-codec - - + 4.0.0 + + org.onap.ccsdk.sli.plugins + restapi-call-node + 6.0.0-SNAPSHOT + + restapi-call-node-provider + bundle + RESTAPI Call Node - Provider + http://maven.apache.org + + UTF-8 + + + + junit + junit + test + + + org.springframework + spring-test + 3.1.4.RELEASE + test + + + org.onap.ccsdk.sli + sli-common + compile + + + org.onap.ccsdk.sli + sli-provider + compile + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.springframework + spring-beans + 3.1.4.RELEASE + + + org.springframework + spring-context + 3.1.4.RELEASE + + + xerces + xerces + 2.4.0 + provided + + + com.sun.jersey + jersey-client + 1.17 + + + commons-codec + commons-codec + + - - - - com.brocade.developer - providermodule-plugin - - org.onap.ccsdk.sli.plugins - restapi-call-node - - - - process-sources - - process - - - - + + + + com.brocade.developer + providermodule-plugin + + org.onap.ccsdk.sli.plugins + restapi-call-node + + + + process-sources + + process + + + + - - org.apache.felix - maven-bundle-plugin - true - - - org.onap.ccsdk.sli.plugins.restapicall - org.onap.ccsdk.sli.plugins.restapicall - * - + + org.apache.felix + maven-bundle-plugin + true + + + org.onap.ccsdk.sli.plugins.restapicall + org.onap.ccsdk.sli.plugins.restapicall + * + - ${project.basedir}/src/main/resources/META-INF + ${project.basedir}/src/main/resources/META-INF - + - + - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - com.brocade.developer - - - providermodule-plugin - - - [1.2.0.100-SNAPSHOT,) - - - process - - - - - - - - - - - - - + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + com.brocade.developer + + + providermodule-plugin + + + [1.2.0.100-SNAPSHOT,) + + + process + + + + + + + + + + + + + diff --git a/restapi-call-node/provider/src/test/resources/test3.xml b/restapi-call-node/provider/src/test/resources/test3.xml index 809a208eb..ade412681 100644 --- a/restapi-call-node/provider/src/test/resources/test3.xml +++ b/restapi-call-node/provider/src/test/resources/test3.xml @@ -21,62 +21,62 @@ --> - - ICOREPVC-81114561 - - VPNL811182 - 811182 - 21302:811182 - SET_BVOIP_IN - SET6_BVOIP_IN - SET6_DSU - SET_DSU - SET6_MANAGED - SET_MANAGED - SET_LOVRF_COMMUNITY - SET_RESET_LP - - AG_MAX_MCASTROUTES - - - - BGP4_PROTOCOL - v4 - gp_21302:811182 - - AG_L3VPN_EBGP - - - AG_MAX_PREFIX - - - AG_BGP_UNMANAGED - - - AG_BFD_BGP_3000 - - - - BGP4_PROTOCOL - v6 - gp6_21302:811182 - - AG6_L3VPN_EBGP - - - AG6_MAX_PREFIX - - - AG6_BGP_UNMANAGED - - - AG6_BFD_BGP_3000 - - - - 200 - Success - Y + xmlns:ns2="http://onap.org/prov/vpn/schema/v2"> + + ICOREPVC-81114561 + + VPNL811182 + 811182 + 21302:811182 + SET_BVOIP_IN + SET6_BVOIP_IN + SET6_DSU + SET_DSU + SET6_MANAGED + SET_MANAGED + SET_LOVRF_COMMUNITY + SET_RESET_LP + + AG_MAX_MCASTROUTES + + + + BGP4_PROTOCOL + v4 + gp_21302:811182 + + AG_L3VPN_EBGP + + + AG_MAX_PREFIX + + + AG_BGP_UNMANAGED + + + AG_BFD_BGP_3000 + + + + BGP4_PROTOCOL + v6 + gp6_21302:811182 + + AG6_L3VPN_EBGP + + + AG6_MAX_PREFIX + + + AG6_BGP_UNMANAGED + + + AG6_BFD_BGP_3000 + + + + 200 + Success + Y - + -- cgit 1.2.3-korg From ac453f1bde56bf95b263113fd475ceee80ac9117 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Thu, 7 Sep 2017 18:40:47 +0530 Subject: Fix sonar issues for ccsdk plugin few major issues https://sonar.onap.org/dashboard/index?id=org.onap.ccsdk.sli.plugins%3Arestapi-call-node-provider%3Asrc%2Fmain%2Fjava%2Forg%2Fonap%2Fccsdk%2Fsli%2Fplugins%2Frestapicall%2FRestapiCallNode.java Issue-ID: SDNC-75 Change-Id: Ida6ea182545bf57513bcd958519e3b50dfa004b2 Signed-off-by: surya-huawei --- .../sli/plugins/restapicall/RestapiCallNode.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index fb7722686..7ddeb4269 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -173,7 +173,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (retryCount < retryPolicy.getMaximumRetries() + 1) { URI uri = new URI(paramMap.get("restapiUrl")); String hostname = uri.getHost(); - String retryString = retryPolicy.getNextHostName((uri.toString())); + String retryString = retryPolicy.getNextHostName(uri.toString()); URI uriTwo = new URI(retryString); URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port(uriTwo.getPort()).scheme( uriTwo.getScheme()).build(); @@ -212,7 +212,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); p.listNameList = getListNameList(paramMap); String skipSendingStr = paramMap.get("skipSending"); - p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + p.skipSending = "true".equalsIgnoreCase(skipSendingStr); p.convertResponse = Boolean.valueOf(parseParam(paramMap, "convertResponse", false, "true")); p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", false, null); p.trustStorePassword = parseParam(paramMap, "trustStorePassword", false, null); @@ -228,9 +228,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { protected Set getListNameList(Map paramMap) { Set ll = new HashSet(); - for (String key : paramMap.keySet()) - if (key.startsWith("listName")) - ll.add(paramMap.get(key)); + for (Map.Entry entry : paramMap.entrySet()) + if (entry.getKey().startsWith("listName")) + ll.add(entry.getValue()); return ll; } @@ -503,12 +503,12 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } protected void setFailureResponseStatus(SvcLogicContext ctx, String prefix, String errorMessage, HttpResponse r) { - r = new HttpResponse(); - r.code = 500; - r.message = errorMessage; + HttpResponse resp = new HttpResponse(); + resp.code = 500; + resp.message = errorMessage; String pp = prefix != null ? prefix + '.' : ""; - ctx.setAttribute(pp + "response-code", String.valueOf(r.code)); - ctx.setAttribute(pp + "response-message", r.message); + ctx.setAttribute(pp + "response-code", String.valueOf(resp.code)); + ctx.setAttribute(pp + "response-message", resp.message); } protected void setResponseStatus(SvcLogicContext ctx, String prefix, HttpResponse r) { @@ -633,7 +633,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; - String req = null; + String req; if (p.templateFileName == null) { log.info("No template file name specified. Using default UEB template: " + defaultUebTemplateFileName); @@ -679,7 +679,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.rootVarName = parseParam(paramMap, "rootVarName", false, null); p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); String skipSendingStr = paramMap.get("skipSending"); - p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + p.skipSending = "true".equalsIgnoreCase(skipSendingStr); return p; } -- cgit 1.2.3-korg From 4892ec15aadfddd266daa91ccef4d47085a04202 Mon Sep 17 00:00:00 2001 From: shashikanth Date: Fri, 8 Sep 2017 18:46:42 +0530 Subject: Fix Blocker/Critical sonar issues Fix Blocker/Critical sonar issues in vnfapi module https://sonar.onap.org/component_issues?id=org.onap.ccsdk.sli.plugins%3Accsdk-sli-plugins#resolved=false|severities=BLOCKER Issue-Id: CCSDK-67 Change-Id: I6393ebbaf4bd6dc2dea4a325f2a7d106ba20dd81 Signed-off-by: shashikanth.vh --- .../java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 7ddeb4269..13295741c 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -627,7 +627,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } public void postMessageOnUeb(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - HttpResponse r = null; + HttpResponse r; try { UebParam p = getUebParameters(paramMap); @@ -659,7 +659,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { setResponseStatus(ctx, prefix, r); } - if (r != null && r.code >= 300) + if (r.code >= 300) throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); } -- cgit 1.2.3-korg From 322886522453c65818199d3575e34d554d3b28ee Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Mon, 11 Sep 2017 17:51:24 +0530 Subject: Fix Sonar Issues Few major issues in Restapi call node Issue-Id: CCSDK-87 Change-Id: Ieb733fcf178cecb9983b5135be8d7737cb42a1f3 Signed-off-by: surya-huawei --- .../org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java | 2 +- .../java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java | 2 +- .../main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java index b139da279..775137fff 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java @@ -44,7 +44,7 @@ public class RetryPolicyStore { } public RetryPolicyStore() { - retryPolicies = new HashMap(); + retryPolicies = new HashMap<>(); } public RetryPolicy getRetryPolicy(String policyName) { diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java index 16b9f519f..e80ca5081 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -366,7 +366,7 @@ public class XmlJsonUtil { private static String pad(int n) { String s = ""; for (int i = 0; i < n; i++) - s += '\t'; + s += Character.toString('\t'); return s; } } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java index 85c9dc018..61b0e31d4 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java @@ -69,7 +69,7 @@ public class XmlParser { super(); this.listNameList = listNameList; if (this.listNameList == null) - this.listNameList = new HashSet(); + this.listNameList = new HashSet<>(); } String currentName = ""; @@ -88,7 +88,7 @@ public class XmlParser { name = name.substring(i2 + 1); if (currentName.length() > 0) - currentName += '.'; + currentName += Character.toString('.'); currentName += name; String listName = removeIndexes(currentName); @@ -152,7 +152,7 @@ public class XmlParser { else if (c == ']') add = true; else if (add) - s += c; + s += Character.toString(c); } return s; } -- cgit 1.2.3-korg From d20f5326f744399c9e741c306043b500991953c8 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Thu, 14 Sep 2017 16:42:27 +0530 Subject: Fix Sonar Issues few critical/major issues in sli/plugins module Issue-Id: CCSDK-87 Change-Id: I4fc33df4ed782670252c9b550349f45b6618c77c Signed-off-by: surya-huawei --- .../java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java | 4 ++-- .../org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java index 4de4a34d7..f2867f5a3 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java @@ -40,14 +40,14 @@ public class JsonParser { public static Map convertToProperties(String s) throws JSONException { JSONObject json = new JSONObject(s); - Map wm = new HashMap(); + Map wm = new HashMap<>(); Iterator ii = json.keys(); while (ii.hasNext()) { String key1 = ii.next(); wm.put(key1, json.get(key1)); } - Map mm = new HashMap(); + Map mm = new HashMap<>(); while (!wm.isEmpty()) for (String key : new ArrayList<>(wm.keySet())) { diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 13295741c..4984d1bce 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -147,8 +147,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { mm = JsonParser.convertToProperties(r.body); if (mm != null) - for (String key : mm.keySet()) - ctx.setAttribute(pp + key, mm.get(key)); + for (Map.Entry entry : mm.entrySet()) + ctx.setAttribute(pp + entry.getKey(), entry.getValue()); } } } catch (Exception e) { @@ -227,7 +227,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } protected Set getListNameList(Map paramMap) { - Set ll = new HashSet(); + Set ll = new HashSet<>(); for (Map.Entry entry : paramMap.entrySet()) if (entry.getKey().startsWith("listName")) ll.add(entry.getValue()); @@ -473,7 +473,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } protected SSLContext createSSLContext(Parameters p) { - try { + try (FileInputStream in = new FileInputStream(p.keyStoreFileName)) { System.setProperty("jsse.enableSNIExtension", "false"); System.setProperty("javax.net.ssl.trustStore", p.trustStoreFileName); System.setProperty("javax.net.ssl.trustStorePassword", p.trustStorePassword); @@ -487,7 +487,6 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { }); KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); - FileInputStream in = new FileInputStream(p.keyStoreFileName); KeyStore ks = KeyStore.getInstance("PKCS12"); char[] pwd = p.keyStorePassword.toCharArray(); ks.load(in, pwd); -- cgit 1.2.3-korg From 342453d02784a1bd791848db8af9e3f927710ec0 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Sun, 17 Sep 2017 23:25:14 +0530 Subject: Fix Sonar Issue in sli/plugins module One major issue * move string literal to left side of string comparison Issue-Id: CCSDK-87 Change-Id: I1277c4c5515bd45ad6854c63cf6160f17b7725d0 Signed-off-by: surya-huawei --- .../java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 4984d1bce..ca227c722 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -559,7 +559,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); String skipSendingStr = paramMap.get("skipSending"); - p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true"); + p.skipSending = "true".equalsIgnoreCase(skipSendingStr); return p; } -- cgit 1.2.3-korg From e1b367fbb12a2b36371842491e4b92a6464fb3c3 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Tue, 19 Sep 2017 15:48:21 +0530 Subject: Fix Sonar Issue One major issue in sli/plugins module *Making anonymous inner class a lambda for better code readabilty Issue-Id: CCSDK-87 Change-Id: Ib650546c4c2c86411744379fe5beae828403453d Signed-off-by: surya-huawei --- .../ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index ca227c722..cfd02edd0 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -403,13 +403,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (p.ssl && p.restapiUrl.startsWith("https")) ssl = createSSLContext(p); if (ssl != null) { - HostnameVerifier hostnameVerifier = new HostnameVerifier() { - - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; + HostnameVerifier hostnameVerifier = (hostname, session) -> true; config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, new HTTPSProperties(hostnameVerifier, ssl)); @@ -478,13 +472,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { System.setProperty("javax.net.ssl.trustStore", p.trustStoreFileName); System.setProperty("javax.net.ssl.trustStorePassword", p.trustStorePassword); - HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { - - @Override - public boolean verify(String string, SSLSession ssls) { - return true; - } - }); + HttpsURLConnection.setDefaultHostnameVerifier((string, ssls) -> true); KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); KeyStore ks = KeyStore.getInstance("PKCS12"); -- cgit 1.2.3-korg From 671fbfeca691227bde901595e46cbc3a46ba7429 Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Tue, 19 Sep 2017 15:38:32 +0530 Subject: Using specific exceptions in RestApiCallNode Changes includes 1) Sonar critical fixes stating use of specific exceptions instead of generic one 2) Throw exception for invalid input of repeat times. 3) Added testcases https://sonar.onap.org/component_issues/index?id=org.onap.ccsdk.sli.plugins%3Accsdk-sli-plugins#resolved=false|severities=CRITICAL Change-Id: I2633f857e161bf7068c51ef835b7c2cd5eb5aa62 Issue-Id: CCSDK-67 Signed-off-by: Gaurav Agrawal --- .../sli/plugins/restapicall/RestapiCallNode.java | 105 ++++++++++++++------- .../plugins/restapicall/TestRestapiCallNode.java | 83 +++++++++++++++- 2 files changed, 154 insertions(+), 34 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index ca227c722..4bdbd00a8 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -21,7 +21,11 @@ package org.onap.ccsdk.sli.plugins.restapicall; +import com.sun.jersey.api.client.ClientHandlerException; +import com.sun.jersey.api.client.UniformInterfaceException; import java.io.FileInputStream; +import java.io.IOException; +import java.net.SocketException; import java.net.URI; import java.nio.file.Files; import java.nio.file.Paths; @@ -45,6 +49,7 @@ import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.UriBuilder; import org.apache.commons.lang3.StringUtils; +import org.codehaus.jettison.json.JSONException; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; @@ -114,7 +119,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { throws SvcLogicException { RetryPolicy retryPolicy = null; - HttpResponse r = null; + HttpResponse r = new HttpResponse(); try { Parameters p = getParameters(paramMap); if (p.partner != null) { @@ -151,9 +156,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { ctx.setAttribute(pp + entry.getKey(), entry.getValue()); } } - } catch (Exception e) { + } catch (SvcLogicException | JSONException e) { boolean shouldRetry = false; - if (e.getCause() instanceof java.net.SocketException) { + if (e.getCause().getCause() instanceof SocketException) { shouldRetry = true; } @@ -190,7 +195,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } catch (Exception ex) { log.error("Could not attempt retry.", ex); String retryErrorMessage = - "Retry attempt has failed. No further retry shall be attempted, calling setFailureResponseStatus."; + "Retry attempt has failed. No further retry shall be attempted, calling " + + "setFailureResponseStatus."; setFailureResponseStatus(ctx, prefix, retryErrorMessage, r); } } @@ -270,7 +276,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return value; } - protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) { + protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) + throws SvcLogicException { log.info("Building " + format + " started"); long t1 = System.currentTimeMillis(); @@ -291,7 +298,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { int i2 = template.indexOf('}', i1 + 2); if (i2 < 0) - throw new RuntimeException("Template error: Matching } not found"); + throw new SvcLogicException("Template error: Matching } not found"); String var1 = template.substring(i1 + 2, i2); String value1 = format == Format.XML ? XmlJsonUtil.getXml(mm, var1) : XmlJsonUtil.getJson(mm, var1); @@ -326,7 +333,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return req; } - protected String expandRepeats(SvcLogicContext ctx, String template, int level) { + protected String expandRepeats(SvcLogicContext ctx, String template, int level) throws SvcLogicException { StringBuilder newTemplate = new StringBuilder(); int k = 0; while (k < template.length()) { @@ -338,7 +345,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { int i2 = template.indexOf(':', i1 + 9); if (i2 < 0) - throw new RuntimeException( + throw new SvcLogicException( "Template error: Context variable name followed by : is required after repeat"); // Find the closing }, store in i3 @@ -348,7 +355,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { while (nn > 0 && i < template.length()) { i3 = template.indexOf('}', i); if (i3 < 0) - throw new RuntimeException("Template error: Matching } not found"); + throw new SvcLogicException("Template error: Matching } not found"); int i32 = template.indexOf('{', i); if (i32 >= 0 && i32 < i3) { nn++; @@ -365,8 +372,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { int n = 0; try { n = Integer.parseInt(value1); - } catch (Exception e) { - n = 0; + } catch (NumberFormatException e) { + throw new SvcLogicException("Invalid input of repeat interval, should be an integer value " + + e.getLocalizedMessage(), e); } newTemplate.append(template.substring(k, i1)); @@ -392,12 +400,17 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return expandRepeats(ctx, newTemplate.toString(), level + 1); } - protected String readFile(String fileName) throws Exception { - byte[] encoded = Files.readAllBytes(Paths.get(fileName)); - return new String(encoded, "UTF-8"); + protected String readFile(String fileName) throws SvcLogicException { + try { + byte[] encoded = Files.readAllBytes(Paths.get(fileName)); + return new String(encoded, "UTF-8"); + } catch (IOException | SecurityException e) { + throw new SvcLogicException("Unable to read file " + fileName + e.getLocalizedMessage(), e); + } } - protected HttpResponse sendHttpRequest(String request, Parameters p) throws Exception { + protected HttpResponse sendHttpRequest(String request, Parameters p) throws SvcLogicException { + ClientConfig config = new DefaultClientConfig(); SSLContext ssl = null; if (p.ssl && p.restapiUrl.startsWith("https")) @@ -451,7 +464,14 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { webResourceBuilder.header("X-ECOMP-RequestID",org.slf4j.MDC.get("X-ECOMP-RequestID")); - ClientResponse response = webResourceBuilder.method(p.httpMethod.toString(), ClientResponse.class, request); + ClientResponse response; + + try { + response = webResourceBuilder.method(p.httpMethod.toString(), ClientResponse.class, request); + } catch (UniformInterfaceException | ClientHandlerException e) { + throw new SvcLogicException("Exception while sending http request to client " + + e.getLocalizedMessage(), e); + } r.code = response.getStatus(); r.headers = response.getHeaders(); @@ -501,8 +521,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return null; } - protected void setFailureResponseStatus(SvcLogicContext ctx, String prefix, String errorMessage, HttpResponse r) { - HttpResponse resp = new HttpResponse(); + protected void setFailureResponseStatus(SvcLogicContext ctx, String prefix, String errorMessage, + HttpResponse resp) { resp.code = 500; resp.message = errorMessage; String pp = prefix != null ? prefix + '.' : ""; @@ -525,7 +545,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { r = sendHttpData(data, p); setResponseStatus(ctx, p.responsePrefix, r); - } catch (Exception e) { + } catch (SvcLogicException | IOException e) { log.error("Error sending the request: " + e.getMessage(), e); r = new HttpResponse(); @@ -563,7 +583,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return p; } - protected HttpResponse sendHttpData(byte[] data, FileParam p) { + protected HttpResponse sendHttpData(byte[] data, FileParam p) throws SvcLogicException { Client client = Client.create(); client.setConnectTimeout(5000); client.setFollowRedirects(true); @@ -580,11 +600,18 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (!p.skipSending) { String tt = "application/octet-stream"; - ClientResponse response = null; - if (p.httpMethod == HttpMethod.POST) - response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); - else if (p.httpMethod == HttpMethod.PUT) - response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); + ClientResponse response; + try { + if (p.httpMethod == HttpMethod.POST) + response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); + else if (p.httpMethod == HttpMethod.PUT) + response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); + else + throw new SvcLogicException("Http operation" + p.httpMethod + "not supported"); + } catch (UniformInterfaceException | ClientHandlerException e) { + throw new SvcLogicException("Exception while sending http request to client " + + e.getLocalizedMessage(), e); + } r.code = response.getStatus(); r.headers = response.getHeaders(); @@ -601,10 +628,17 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { webResource = client.resource(newUrl); - if (p.httpMethod == HttpMethod.POST) - response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); - else if (p.httpMethod == HttpMethod.PUT) - response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); + try { + if (p.httpMethod == HttpMethod.POST) + response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); + else if (p.httpMethod == HttpMethod.PUT) + response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); + else + throw new SvcLogicException("Http operation" + p.httpMethod + "not supported"); + } catch (UniformInterfaceException | ClientHandlerException e) { + throw new SvcLogicException("Exception while sending http request to client " + + e.getLocalizedMessage(), e); + } r.code = response.getStatus(); etag = response.getEntityTag(); @@ -648,7 +682,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (r.body != null) ctx.setAttribute(pp + "httpResponse", r.body); - } catch (Exception e) { + } catch (SvcLogicException e) { log.error("Error sending the request: " + e.getMessage(), e); r = new HttpResponse(); @@ -682,7 +716,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return p; } - protected HttpResponse postOnUeb(String request, UebParam p) throws Exception { + protected HttpResponse postOnUeb(String request, UebParam p) throws SvcLogicException { String[] urls = uebServers.split(" "); for (int i = 0; i < urls.length; i++) { if (!urls[i].endsWith("/")) @@ -706,7 +740,14 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { String tt = "application/json"; String tt1 = tt + ";charset=UTF-8"; - ClientResponse response = webResource.accept(tt).type(tt1).post(ClientResponse.class, request); + ClientResponse response; + + try { + response = webResource.accept(tt).type(tt1).post(ClientResponse.class, request); + } catch (UniformInterfaceException | ClientHandlerException e) { + throw new SvcLogicException("Exception while posting http request to client " + + e.getLocalizedMessage(), e); + } r.code = response.getStatus(); r.headers = response.getHeaders(); diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index ff9714809..51c394783 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -26,6 +26,7 @@ import java.util.Map; import org.junit.Test; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,7 +37,7 @@ public class TestRestapiCallNode { @Test - public void testDelete() throws Exception { + public void testDelete() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); Map p = new HashMap(); @@ -51,7 +52,7 @@ public class TestRestapiCallNode { } @Test - public void testJsonTemplate() throws Exception { + public void testJsonTemplate() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); @@ -89,4 +90,82 @@ public class TestRestapiCallNode { RestapiCallNode rcn = new RestapiCallNode(); rcn.sendRequest(p, ctx); } + + @Test(expected = SvcLogicException.class) + public void testInvalidRepeatTimes() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "a"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidTemplatePath() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resourcess/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testWithoutSkipSending() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } } -- cgit 1.2.3-korg From 02e1594ffee2231523d0486a5d8b590ff09581df Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Tue, 19 Sep 2017 17:40:54 +0530 Subject: Refinements to RestApiCall plugin Changes includes: 1) Check for null in JsonParser.convertToProperties() which can otherwise result in null pointer exception 2) Use logger built-in string formatting rather then string concatenation 3) Use StringBuilder for multiple string concatenations 4) Making utility classes final and defines private constructor for them 5) Added testcases/testpoints https://sonar.onap.org/component_issues/index?id=org.onap.ccsdk.sli.plugins%3Accsdk-sli-plugins#resolved=false|severities=CRITICAL Change-Id: Ic047b6d0369827a38a98c52e8365f1fe7266840f Issue-Id: CCSDK-67 Signed-off-by: Gaurav Agrawal --- .../ccsdk/sli/plugins/restapicall/JsonParser.java | 85 ++++++++++++---------- .../ccsdk/sli/plugins/restapicall/XmlJsonUtil.java | 14 ++-- .../ccsdk/sli/plugins/restapicall/XmlParser.java | 62 +++++++++------- .../sli/plugins/restapicall/TestJsonParser.java | 20 +++-- .../sli/plugins/restapicall/TestXmlParser.java | 10 +-- .../provider/src/test/resources/test.json | 5 +- 6 files changed, 114 insertions(+), 82 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java index f2867f5a3..4a1dfef50 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java @@ -21,6 +21,8 @@ package org.onap.ccsdk.sli.plugins.restapicall; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -29,57 +31,64 @@ import java.util.Map; import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class JsonParser { +public final class JsonParser { private static final Logger log = LoggerFactory.getLogger(JsonParser.class); - @SuppressWarnings("unchecked") - public static Map convertToProperties(String s) throws JSONException { - JSONObject json = new JSONObject(s); - - Map wm = new HashMap<>(); - Iterator ii = json.keys(); - while (ii.hasNext()) { - String key1 = ii.next(); - wm.put(key1, json.get(key1)); - } - - Map mm = new HashMap<>(); + private JsonParser() { + // Preventing instantiation of the same. + } - while (!wm.isEmpty()) - for (String key : new ArrayList<>(wm.keySet())) { - Object o = wm.get(key); - wm.remove(key); + @SuppressWarnings("unchecked") + public static Map convertToProperties(String s) + throws SvcLogicException { + + checkNotNull(s, "Input should not be null."); + + try { + JSONObject json = new JSONObject(s); + Map wm = new HashMap<>(); + Iterator ii = json.keys(); + while (ii.hasNext()) { + String key1 = ii.next(); + wm.put(key1, json.get(key1)); + } - if (o instanceof Boolean || o instanceof Number || o instanceof String) { - mm.put(key, o.toString()); + Map mm = new HashMap<>(); - log.info("Added property: " + key + ": " + o.toString()); - } + while (!wm.isEmpty()) + for (String key : new ArrayList<>(wm.keySet())) { + Object o = wm.get(key); + wm.remove(key); - else if (o instanceof JSONObject) { - JSONObject jo = (JSONObject) o; - Iterator i = jo.keys(); - while (i.hasNext()) { - String key1 = i.next(); - wm.put(key + "." + key1, jo.get(key1)); - } - } + if (o instanceof Boolean || o instanceof Number || o instanceof String) { + mm.put(key, o.toString()); - else if (o instanceof JSONArray) { - JSONArray ja = (JSONArray) o; - mm.put(key + "_length", String.valueOf(ja.length())); + log.info("Added property: {} : {}", key, o.toString()); + } else if (o instanceof JSONObject) { + JSONObject jo = (JSONObject) o; + Iterator i = jo.keys(); + while (i.hasNext()) { + String key1 = i.next(); + wm.put(key + "." + key1, jo.get(key1)); + } + } else if (o instanceof JSONArray) { + JSONArray ja = (JSONArray) o; + mm.put(key + "_length", String.valueOf(ja.length())); - log.info("Added property: " + key + "_length" + ": " + String.valueOf(ja.length())); + log.info("Added property: {}_length: {}", key, String.valueOf(ja.length())); - for (int i = 0; i < ja.length(); i++) - wm.put(key + '[' + i + ']', ja.get(i)); + for (int i = 0; i < ja.length(); i++) + wm.put(key + '[' + i + ']', ja.get(i)); + } } - } - - return mm; + return mm; + } catch (JSONException e) { + throw new SvcLogicException("Unable to convert JSON to properties" + e.getLocalizedMessage(), e); + } } } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java index e80ca5081..b94f0a638 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -29,10 +29,14 @@ import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class XmlJsonUtil { +public final class XmlJsonUtil { private static final Logger log = LoggerFactory.getLogger(XmlJsonUtil.class); + private XmlJsonUtil() { + // Preventing instantiation of the same. + } + public static String getXml(Map varmap, String var) { boolean escape = true; if (var.startsWith("'")) { @@ -99,7 +103,7 @@ public class XmlJsonUtil { try { length = Integer.parseInt(lengthStr); } catch (Exception e) { - log.warn("Invalid number for " + var + "_length:" + lengthStr); + log.warn("Invalid number for {}_length:{}", var, lengthStr); } } @@ -364,9 +368,9 @@ public class XmlJsonUtil { } private static String pad(int n) { - String s = ""; + StringBuilder s = new StringBuilder(); for (int i = 0; i < n; i++) - s += Character.toString('\t'); - return s; + s.append(Character.toString('\t')); + return s.toString(); } } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java index 61b0e31d4..7ef776da1 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java @@ -21,37 +21,49 @@ package org.onap.ccsdk.sli.plugins.restapicall; +import static com.google.common.base.Preconditions.checkNotNull; + import java.io.ByteArrayInputStream; +import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; +import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -public class XmlParser { +public final class XmlParser { private static final Logger log = LoggerFactory.getLogger(XmlParser.class); - public static Map convertToProperties(String s, Set listNameList) { + private XmlParser() { + // Preventing instantiation of the same. + } + + public static Map convertToProperties(String s, Set listNameList) + throws SvcLogicException { + + checkNotNull(s, "Input should not be null."); + Handler handler = new Handler(listNameList); try { SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); InputStream in = new ByteArrayInputStream(s.getBytes()); saxParser.parse(in, handler); - } catch (Exception e) { - e.printStackTrace(); + } catch (ParserConfigurationException | IOException | SAXException e) { + throw new SvcLogicException("Unable to convert XML to properties" + e.getLocalizedMessage(), e); } - return handler.getProperties(); } @@ -72,8 +84,8 @@ public class XmlParser { this.listNameList = new HashSet<>(); } - String currentName = ""; - String currentValue = ""; + StringBuilder currentName = new StringBuilder(); + StringBuilder currentValue = new StringBuilder(); @Override public void startElement(String uri, String localName, String qName, Attributes attributes) @@ -88,15 +100,16 @@ public class XmlParser { name = name.substring(i2 + 1); if (currentName.length() > 0) - currentName += Character.toString('.'); - currentName += name; + currentName.append(Character.toString('.')); + currentName.append(name); - String listName = removeIndexes(currentName); + String listName = removeIndexes(currentName.toString()); if (listNameList.contains(listName)) { - int len = getInt(properties, currentName + "_length"); - properties.put(currentName + "_length", String.valueOf(len + 1)); - currentName += "[" + len + "]"; + String n = currentName.toString() + "_length"; + int len = getInt(properties, n); + properties.put(n, String.valueOf(len + 1)); + currentName.append("[").append(len).append("]"); } } @@ -111,20 +124,19 @@ public class XmlParser { if (i2 >= 0) name = name.substring(i2 + 1); - if (currentValue.trim().length() > 0) { - currentValue = currentValue.trim(); - properties.put(currentName, currentValue); - - log.info("Added property: " + currentName + ": " + currentValue); + String s = currentValue.toString().trim(); + if (s.length() > 0) { + properties.put(currentName.toString(), s); - currentValue = ""; + log.info("Added property: {} : {}", currentName, s); + currentValue = new StringBuilder(); } int i1 = currentName.lastIndexOf("." + name); if (i1 <= 0) - currentName = ""; + currentName = new StringBuilder(); else - currentName = currentName.substring(0, i1); + currentName = new StringBuilder(currentName.substring(0, i1)); } @Override @@ -132,7 +144,7 @@ public class XmlParser { super.characters(ch, start, length); String value = new String(ch, start, length); - currentValue += value; + currentValue.append(value); } private static int getInt(Map mm, String name) { @@ -143,7 +155,7 @@ public class XmlParser { } private String removeIndexes(String currentName) { - String s = ""; + StringBuilder b = new StringBuilder(); boolean add = true; for (int i = 0; i < currentName.length(); i++) { char c = currentName.charAt(i); @@ -152,9 +164,9 @@ public class XmlParser { else if (c == ']') add = true; else if (add) - s += Character.toString(c); + b.append(Character.toString(c)); } - return s; + return b.toString(); } } } diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java index dbca5ad7b..5526be81f 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java @@ -22,6 +22,7 @@ package jtest.org.onap.ccsdk.sli.plugins.restapicall; import java.io.BufferedReader; +import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; @@ -29,6 +30,7 @@ import java.util.List; import java.util.Map; import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.plugins.restapicall.JsonParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,30 +40,34 @@ public class TestJsonParser { private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); @Test - public void test() throws Exception { + public void test() throws SvcLogicException, IOException { BufferedReader in = new BufferedReader( new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) ); - String ss = ""; - String line = null; + StringBuilder b = new StringBuilder(); + String line; while ((line = in.readLine()) != null) - ss += line + '\n'; + b.append(line).append('\n'); - Map mm = JsonParser.convertToProperties(ss); + Map mm = JsonParser.convertToProperties(b.toString()); logProperties(mm); in.close(); } + @Test(expected = NullPointerException.class) + public void testNullString() throws SvcLogicException { + JsonParser.convertToProperties(null); + } + private void logProperties(Map mm) { List ll = new ArrayList<>(); for (Object o : mm.keySet()) ll.add((String) o); Collections.sort(ll); - log.info("Properties:"); for (String name : ll) - log.info("--- " + name + ": " + mm.get(name)); + log.info("--- {}: {}", name, mm.get(name)); } } diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java index 544d259e0..e8567d591 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java @@ -44,10 +44,10 @@ public class TestXmlParser { BufferedReader in = new BufferedReader( new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) ); - String ss = ""; - String line = null; + StringBuilder b = new StringBuilder(); + String line; while ((line = in.readLine()) != null) - ss += line + '\n'; + b.append(line).append('\n'); Set listNameList = new HashSet(); listNameList.add("project.dependencies.dependency"); @@ -57,10 +57,8 @@ public class TestXmlParser { listNameList.add("project.build.pluginManagement." + "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); - Map mm = XmlParser.convertToProperties(ss, listNameList); - + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); logProperties(mm); - in.close(); } diff --git a/restapi-call-node/provider/src/test/resources/test.json b/restapi-call-node/provider/src/test/resources/test.json index a34f7e2a0..b48eb6b43 100644 --- a/restapi-call-node/provider/src/test/resources/test.json +++ b/restapi-call-node/provider/src/test/resources/test.json @@ -27,7 +27,10 @@ "number-primary-servers": "2", "equipment-id": "Server1", "server-model": "Unknown", - "server-id": "Server1" + "server-id": "Server1", + "test-node" : { + "test-inner-node" : "Test-Value" + } } ], "resource-state": { -- cgit 1.2.3-korg From ba209b4de55c56e5c427e3389518966f2c896661 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 19 Sep 2017 20:48:48 -0400 Subject: Remove unthrown exception Merge build fails because catch statement is trying to catch JSONException which is not thrown in body of try Change-Id: I9e29e1698e04f8135799440ca4859aa418d1c54d Issue-ID: CCSDK-99 Signed-off-by: Dan Timoney --- .../org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 60697a423..20c13daac 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -8,9 +8,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -156,7 +156,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { ctx.setAttribute(pp + entry.getKey(), entry.getValue()); } } - } catch (SvcLogicException | JSONException e) { + } catch (SvcLogicException e) { boolean shouldRetry = false; if (e.getCause().getCause() instanceof SocketException) { shouldRetry = true; -- cgit 1.2.3-korg From 33bfbaf4a7c2c33fc0b0b5ab18a5553dd8884cf7 Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Wed, 20 Sep 2017 11:48:54 +0530 Subject: Changes to RestApiCall plugin Changes includes 1. Perform validation of URL syntax during parameter parsing phase. 2. StringBuilder to replace string concatenation within loop. 3. Testcase addition. 4. Sonar critical issue fix for XmlJsonUtil 5) Use logger built-in string formatting rather then string concatenation https://sonar.onap.org/component_issues/index?id=org.onap.ccsdk.sli.plugins%3Accsdk-sli-plugins#resolved=false|severities=CRITICAL Change-Id: I884af51023bbd4983c43707aca97c398d24fc9de Issue-Id: CCSDK-67 Signed-off-by: Gaurav Agrawal --- .../sli/plugins/restapicall/RestapiCallNode.java | 73 ++++++++++++---------- .../ccsdk/sli/plugins/restapicall/XmlJsonUtil.java | 2 +- .../plugins/restapicall/TestRestapiCallNode.java | 27 ++++++++ 3 files changed, 69 insertions(+), 33 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 20c13daac..c4ad4c55b 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -183,10 +183,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port(uriTwo.getPort()).scheme( uriTwo.getScheme()).build(); paramMap.put("restapiUrl", retryUri.toString()); - log.debug("URL was set to " + retryUri.toString()); - log.debug("Failed to communicate with host " + hostname + - ". Request will be re-attempted using the host " + retryString + "."); - log.debug("This is retry attempt " + retryCount + " out of " + retryPolicy.getMaximumRetries()); + log.debug("URL was set to {}", retryUri.toString()); + log.debug("Failed to communicate with host {}. Request will be re-attempted using the host {}.", + hostname, retryString); + log.debug("This is retry attempt {} out of {}", retryCount, retryPolicy.getMaximumRetries()); sendRequest(paramMap, ctx, retryCount); } else { log.debug("Maximum retries reached, calling setFailureResponseStatus."); @@ -210,6 +210,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { Parameters p = new Parameters(); p.templateFileName = parseParam(paramMap, "templateFileName", false, null); p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); + validateUrl(p.restapiUrl); p.restapiUser = parseParam(paramMap, "restapiUser", false, null); p.restapiPassword = parseParam(paramMap, "restapiPassword", false, null); p.contentType = parseParam(paramMap, "contentType", false, null); @@ -232,6 +233,14 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return p; } + private void validateUrl(String restapiUrl) throws SvcLogicException { + try { + URI.create(restapiUrl); + } catch (IllegalArgumentException e) { + throw new SvcLogicException("Invalid input of url " + e.getLocalizedMessage(), e); + } + } + protected Set getListNameList(Map paramMap) { Set ll = new HashSet<>(); for (Map.Entry entry : paramMap.entrySet()) @@ -251,7 +260,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } s = s.trim(); - String value = ""; + StringBuilder value = new StringBuilder(); int i = 0; int i1 = s.indexOf('%'); while (i1 >= 0) { @@ -264,21 +273,21 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (varValue == null) varValue = "%" + varName + "%"; - value += s.substring(i, i1); - value += varValue; + value.append(s.substring(i, i1)); + value.append(varValue); i = i2 + 1; i1 = s.indexOf('%', i); } - value += s.substring(i); + value.append(s.substring(i)); - log.info("Parameter " + name + ": [" + value + "]"); - return value; + log.info("Parameter {}: [{}]", name, value); + return value.toString(); } protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) throws SvcLogicException { - log.info("Building " + format + " started"); + log.info("Building {} started", format); long t1 = System.currentTimeMillis(); template = expandRepeats(ctx, template, 1); @@ -328,7 +337,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { req = XmlJsonUtil.removeLastCommaJson(req); long t2 = System.currentTimeMillis(); - log.info("Building " + format + " completed. Time: " + (t2 - t1)); + log.info("Building {} completed. Time: {}", format, (t2 - t1)); return req; } @@ -368,7 +377,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { String var1 = template.substring(i1 + 9, i2); String value1 = ctx.getAttribute(var1); - log.info(" " + var1 + ": " + value1); + log.info(" {}:{}", var1, value1); int n = 0; try { n = Integer.parseInt(value1); @@ -477,11 +486,11 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } long t2 = System.currentTimeMillis(); - log.info("Response received. Time: " + (t2 - t1)); - log.info("HTTP response code: " + r.code); - log.info("HTTP response message: " + r.message); + log.info("Response received. Time: {}", (t2 - t1)); + log.info("HTTP response code: {}", r.code); + log.info("HTTP response message: {}", r.message); logHeaders(r.headers); - log.info("HTTP response: " + r.body); + log.info("HTTP response: {}", r.body); return r; } @@ -504,7 +513,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { ctx.init(kmf.getKeyManagers(), null, null); return ctx; } catch (Exception e) { - log.error("Error creating SSLContext: " + e.getMessage(), e); + log.error("Error creating SSLContext: {}", e.getMessage(), e); } return null; } @@ -534,7 +543,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { setResponseStatus(ctx, p.responsePrefix, r); } catch (SvcLogicException | IOException e) { - log.error("Error sending the request: " + e.getMessage(), e); + log.error("Error sending the request: {}", e.getMessage(), e); r = new HttpResponse(); r.code = 500; @@ -612,7 +621,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (r.code == 301) { String newUrl = response.getHeaders().getFirst("Location"); - log.info("Got response code 301. Sending same request to URL: " + newUrl); + log.info("Got response code 301. Sending same request to URL: {}", newUrl); webResource = client.resource(newUrl); @@ -638,11 +647,11 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } long t2 = System.currentTimeMillis(); - log.info("Response received. Time: " + (t2 - t1)); - log.info("HTTP response code: " + r.code); - log.info("HTTP response message: " + r.message); + log.info("Response received. Time: {}", (t2 - t1)); + log.info("HTTP response code: {}", r.code); + log.info("HTTP response message: {}", r.message); logHeaders(r.headers); - log.info("HTTP response: " + r.body); + log.info("HTTP response: {}", r.body); return r; } @@ -657,7 +666,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { String req; if (p.templateFileName == null) { - log.info("No template file name specified. Using default UEB template: " + defaultUebTemplateFileName); + log.info("No template file name specified. Using default UEB template: {}", defaultUebTemplateFileName); p.templateFileName = defaultUebTemplateFileName; } @@ -671,7 +680,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { ctx.setAttribute(pp + "httpResponse", r.body); } catch (SvcLogicException e) { - log.error("Error sending the request: " + e.getMessage(), e); + log.error("Error sending the request: {}", e.getMessage(), e); r = new HttpResponse(); r.code = 500; @@ -716,7 +725,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { client.setConnectTimeout(5000); WebResource webResource = client.resource(urls[0]); - log.info("UEB URL: " + urls[0]); + log.info("UEB URL: {}", urls[0]); log.info("Sending request:"); log.info(request); long t1 = System.currentTimeMillis(); @@ -744,10 +753,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } long t2 = System.currentTimeMillis(); - log.info("Response received. Time: " + (t2 - t1)); - log.info("HTTP response code: " + r.code); + log.info("Response received. Time: {}", (t2 - t1)); + log.info("HTTP response code: {}", r.code); logHeaders(r.headers); - log.info("HTTP response:\n" + r.body); + log.info("HTTP response:\n {}", r.body); return r; } @@ -760,7 +769,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { log.info("Properties:"); for (String name : ll) - log.info("--- " + name + ": " + String.valueOf(mm.get(name))); + log.info("--- {}:{}", name, String.valueOf(mm.get(name))); } protected void logHeaders(MultivaluedMap mm) { @@ -775,7 +784,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { Collections.sort(ll); for (String name : ll) - log.info("--- " + name + ": " + String.valueOf(mm.get(name))); + log.info("--- {}:{}", name, String.valueOf(mm.get(name))); } public void setUebServers(String uebServers) { diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java index b94f0a638..359501fc4 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -103,7 +103,7 @@ public final class XmlJsonUtil { try { length = Integer.parseInt(lengthStr); } catch (Exception e) { - log.warn("Invalid number for {}_length:{}", var, lengthStr); + log.warn("Invalid number for {}_length:{}", var, lengthStr, e); } } diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 51c394783..118d97d31 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -168,4 +168,31 @@ public class TestRestapiCallNode { RestapiCallNode rcn = new RestapiCallNode(); rcn.sendRequest(p, ctx); } + + + @Test(expected = SvcLogicException.class) + public void testWithInvalidURI() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo. getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } } -- cgit 1.2.3-korg From 72e394582ceeb86e35d2c5cb34b244b38ae5659f Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Wed, 20 Sep 2017 12:43:42 +0530 Subject: Refinements and test additions to XmlParser Changes includes 1) Added validation for invalid length 2) Added testcases to test length Change-Id: Iefd56ca470382be139f185fdf84b6c0de0fa99f6 Issue-Id: CCSDK-100 Signed-off-by: Gaurav Agrawal --- .../ccsdk/sli/plugins/restapicall/XmlParser.java | 2 +- .../sli/plugins/restapicall/TestXmlParser.java | 46 ++++++++++++++++++++ .../provider/src/test/resources/invalidlength.xml | 49 ++++++++++++++++++++++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 restapi-call-node/provider/src/test/resources/invalidlength.xml (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java index 7ef776da1..9aede5b7e 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java @@ -61,7 +61,7 @@ public final class XmlParser { SAXParser saxParser = factory.newSAXParser(); InputStream in = new ByteArrayInputStream(s.getBytes()); saxParser.parse(in, handler); - } catch (ParserConfigurationException | IOException | SAXException e) { + } catch (ParserConfigurationException | IOException | SAXException | NumberFormatException e) { throw new SvcLogicException("Unable to convert XML to properties" + e.getLocalizedMessage(), e); } return handler.getProperties(); diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java index e8567d591..c6bf4a8b9 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java @@ -21,6 +21,9 @@ package jtest.org.onap.ccsdk.sli.plugins.restapicall; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; @@ -31,6 +34,7 @@ import java.util.Map; import java.util.Set; import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.plugins.restapicall.XmlParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -62,6 +66,48 @@ public class TestXmlParser { in.close(); } + @Test + public void testValidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport[5]"), is("SET_RESET_LP")); + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport[0]"), is("SET_BVOIP_IN")); + + logProperties(mm); + in.close(); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("invalidlength.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + private void logProperties(Map mm) { List ll = new ArrayList<>(); for (Object o : mm.keySet()) diff --git a/restapi-call-node/provider/src/test/resources/invalidlength.xml b/restapi-call-node/provider/src/test/resources/invalidlength.xml new file mode 100644 index 000000000..c086d564e --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/invalidlength.xml @@ -0,0 +1,49 @@ + + + + + + ICOREPVC-81114561 + + VPNL811182 + 811182 + 21302:811182 + SET_BVOIP_IN + SET6_BVOIP_IN + a + SET6_DSU + SET_DSU + SET6_MANAGED + SET_MANAGED + SET_LOVRF_COMMUNITY + SET_RESET_LP + + AG_MAX_MCASTROUTES + + + + 200 + Success + Y + + -- cgit 1.2.3-korg From ff9dfa14ecc880d13dfc1ce4648fc4baee9f7d99 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Wed, 20 Sep 2017 16:50:20 +0530 Subject: Use entrySet instead of keySet *Iterating over map entries with entrySet This is done because both key and value are needed and iterating over entryset is more efficient than keyset Issue-Id: CCSDK-87 Change-Id: I31d14239c8f7300ff2d3a629683e00b42e61ad86 Signed-off-by: surya-huawei --- .../ccsdk/sli/plugins/restapicall/XmlJsonUtil.java | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java index b94f0a638..4a04d97d7 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -132,23 +132,24 @@ public final class XmlJsonUtil { if (o instanceof Map) { StringBuilder ss = new StringBuilder(); Map mm = (Map) o; - for (String k : mm.keySet()) { - Object v = mm.get(k); + for (Map.Entry entry: mm.entrySet()) { + Object v = entry.getValue(); + String key = entry.getKey(); if (v instanceof String) { String s = escape ? escapeXml((String) v) : (String) v; - ss.append(pad(indent)).append('<').append(k).append('>'); + ss.append(pad(indent)).append('<').append(key).append('>'); ss.append(s); - ss.append("').append('\n'); + ss.append("').append('\n'); } else if (v instanceof Map) { - ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); + ss.append(pad(indent)).append('<').append(key).append('>').append('\n'); ss.append(generateXml(v, indent + 1, escape)); - ss.append(pad(indent)).append("').append('\n'); + ss.append(pad(indent)).append("').append('\n'); } else if (v instanceof List) { List ll = (List) v; for (Object o1 : ll) { - ss.append(pad(indent)).append('<').append(k).append('>').append('\n'); + ss.append(pad(indent)).append('<').append(key).append('>').append('\n'); ss.append(generateXml(o1, indent + 1, escape)); - ss.append(pad(indent)).append("').append('\n'); + ss.append(pad(indent)).append("').append('\n'); } } } @@ -185,13 +186,13 @@ public final class XmlJsonUtil { ss.append("{\n"); boolean first = true; - for (String k : mm.keySet()) { + for (Map.Entry entry : mm.entrySet()) { if (!first) ss.append(",\n"); first = false; - - Object v = mm.get(k); - ss.append(pad(indent + 1)).append('"').append(k).append("\": "); + Object v = entry.getValue(); + String key = entry.getKey(); + ss.append(pad(indent + 1)).append('"').append(key).append("\": "); generateJson(ss, v, indent + 1, false, escape); } -- cgit 1.2.3-korg From 68607dc808655310f2b62f9fd0228980cb4c2325 Mon Sep 17 00:00:00 2001 From: "ramu.n" Date: Wed, 27 Sep 2017 18:44:14 +0530 Subject: Add underlay JSON template validation Add UT test cases to validate the JSON template used to communicate with 3rd party controller of IP WAN Network Change-Id: I251f5cabecdd7e4f02d0be3bb27d7af4a355c077 Issue-Id: SDNC-90 Signed-off-by: Ramu N --- .../plugins/restapicall/TestRestapiCallNode.java | 64 +++++++- .../src/test/resources/l3smsitetemplate.json | 164 +++++++++++++++++++++ .../src/test/resources/l3smvpntemplate.json | 28 ++++ 3 files changed, 254 insertions(+), 2 deletions(-) create mode 100644 restapi-call-node/provider/src/test/resources/l3smsitetemplate.json create mode 100644 restapi-call-node/provider/src/test/resources/l3smvpntemplate.json (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 118d97d31..2d3b40105 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -8,9 +8,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -195,4 +195,64 @@ public class TestRestapiCallNode { RestapiCallNode rcn = new RestapiCallNode(); rcn.sendRequest(p, ctx); } + + @Test + public void testVpnJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testSiteJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + ctx.setAttribute("prop.l3vpn.site1_name", "10000000-0000-0000-0000-000000000002"); + ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); + ctx.setAttribute("prop.l3vpn.entry1-id", "1"); + ctx.setAttribute("prop.l3vpn.sna1_name", "10000000-0000-0000-0000-000000000004"); + ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); + ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b"); + ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1"); + ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2"); + ctx.setAttribute("prop.l3vpn.sna1-route", "192.168.1.4/24"); + + ctx.setAttribute("prop.l3vpn.site2_name", "10000000-0000-0000-0000-000000000005"); + ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); + ctx.setAttribute("prop.l3vpn.entry2-id", "1"); + ctx.setAttribute("prop.l3vpn.sna2_name", "10000000-0000-0000-0000-000000000007"); + ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); + ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c"); + ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.5"); + ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5"); + ctx.setAttribute("prop.l3vpn.sna2-route", "192.168.1.8/24"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smsitetemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } } diff --git a/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json b/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json new file mode 100644 index 000000000..e7b569289 --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json @@ -0,0 +1,164 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +[ + { + "site-id": ${prop.l3vpn.site1_name}, + "vpn-policies": { + "vpn-policy": [ + { + "vpn-policy-id": ${prop.l3vpn.vpn-policy1-id}, + "entries": [ + { + "id": ${prop.l3vpn.entry1-id}, + "vpn": { + "vpn-id": ${prop.l3vpn.name}, + "site-role": "huawei-ac-net-l3vpn-svc:any-to-any-role" + } + } + ] + } + ] + }, + "site-network-accesses": { + "site-network-access": [ + { + "site-network-access-id": ${prop.l3vpn.sna1_name}, + "bearer": { + "appointed-access": { + "ne-id": ${prop.l3vpn.pe1_id}, + "ltp-id": ${prop.l3vpn.ac1_id}, + "vlan": { + "type": "huawei-ac-net-l3vpn-svc:vlan-dot1q", + "vlan-id": ${prop.l3vpn.sna1_svlan} + } + } + }, + "ip-connection": { + "ipv4": { + "address-allocation-type": "huawei-ac-net-l3vpn-svc:static-address", + "addresses": { + "provider-address": ${prop.l3vpn.ac1-peer-ip}, + "customer-address": ${prop.l3vpn.ac1-ip}, + "mask": "24" + } + } + }, + "service": { + "mtu": "1500" + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "huawei-ac-net-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": [ + { + "ipv4-lan-prefixes": [ + { + "ip-prefix": ${prop.l3vpn.sna1-route}, + "next-hop": ${prop.l3vpn.sna1-route} + } + ] + } + ] + } + } + ] + }, + "vpn-attachment": { + "vpn-policy-id": ${prop.l3vpn.name} + } + } + ] + }, + { + "site-id": ${prop.l3vpn.site2_name}, + "vpn-policies": { + "vpn-policy": [ + { + "vpn-policy-id": ${prop.l3vpn.vpn-policy2-id}, + "entries": [ + { + "id": ${prop.l3vpn.entry2-id}, + "vpn": { + "vpn-id": ${prop.l3vpn.name}, + "site-role": "huawei-ac-net-l3vpn-svc:any-to-any-role" + } + } + ] + } + ] + }, + "site-network-accesses": { + "site-network-access": [ + { + "site-network-access-id": ${prop.l3vpn.sna2_name}, + "bearer": { + "appointed-access": { + "ne-id": ${prop.l3vpn.pe2_id}, + "ltp-id": ${prop.l3vpn.ac2_id}, + "vlan": { + "type": "huawei-ac-net-l3vpn-svc:vlan-dot1q", + "vlan-id": ${prop.l3vpn.sna2_svlan} + } + } + }, + "ip-connection": { + "ipv4": { + "address-allocation-type": "huawei-ac-net-l3vpn-svc:static-address", + "addresses": { + "provider-address": ${prop.l3vpn.ac2-peer-ip}, + "customer-address": ${prop.l3vpn.ac2-ip}, + "mask": "24" + } + } + }, + "service": { + "mtu": "1500" + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "huawei-ac-net-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": [ + { + "ipv4-lan-prefixes": [ + { + "ip-prefix": ${prop.l3vpn.sna2-route}, + "next-hop": ${prop.l3vpn.sna2-route} + } + ] + } + ] + } + } + ] + }, + "vpn-attachment": { + "vpn-policy-id": ${prop.l3vpn.name} + } + } + ] + } +] + diff --git a/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json b/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json new file mode 100644 index 000000000..c0a7c1922 --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "vpn-id": ${prop.l3vpn.name}, + "customer-name": "huawei", + "vpn-service-topology": ${prop.l3vpn.topology}, + "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way" +} + -- cgit 1.2.3-korg From 1f4c154ba6ae1ed672637ab1083e91d4de1d1c75 Mon Sep 17 00:00:00 2001 From: Marcus G K Williams Date: Wed, 27 Sep 2017 10:12:50 -0700 Subject: Add VoLTE Overlay Json template Issue-Id: SDNC-43 Change-Id: I9569f853a722dd43ef8723d2ed16077b5b02a1ff Signed-off-by: Marcus G K Williams --- .../main/resources/l3-dci-connects-template.json | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 restapi-call-node/provider/src/main/resources/l3-dci-connects-template.json (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/resources/l3-dci-connects-template.json b/restapi-call-node/provider/src/main/resources/l3-dci-connects-template.json new file mode 100644 index 000000000..3f0e20304 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/l3-dci-connects-template.json @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Copyright (C) 2017 Intel Corp. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "l3-dci-connect": { + "id": "${prop.l3-dci-connects.id}", + "name": "${prop.l3-dci-connects.name}", + "description": "${prop.l3-dci-connects.description}", + "router_id": "${prop.l3-dci-connects.router_id}", + "firewall_enable": false, + "local_networks": ["${prop.l3-dci-connects.local_networks}"], + "local_network_all": false, + "evpn_irts": ["${prop.l3-dci-connects.evpn_irts}"], + "evpn_erts": ["${prop.l3-dci-connects.evpn_erts}"], + "l3_vni": "${prop.l3-dci-connects.l3_vni}" + } +} -- cgit 1.2.3-korg From 1a6f50f6de487545dbb1e2c713bdf558ce889827 Mon Sep 17 00:00:00 2001 From: "ramu.n" Date: Thu, 28 Sep 2017 08:45:27 +0530 Subject: Add VoLTE underlay JSON template Add VoLTE underlay JSON template used to communicate with 3rd party controller of IP WAN Network Change-Id: Icc93da198c7a1f3d9ed462e178571e316fde3f83 Issue-Id: SDNC-90 Signed-off-by: Ramu N --- .../src/main/resources/l3smsitetemplate.json | 164 +++++++++++++++++++++ .../src/main/resources/l3smvpntemplate.json | 28 ++++ 2 files changed, 192 insertions(+) create mode 100644 restapi-call-node/provider/src/main/resources/l3smsitetemplate.json create mode 100644 restapi-call-node/provider/src/main/resources/l3smvpntemplate.json (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json b/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json new file mode 100644 index 000000000..e7b569289 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json @@ -0,0 +1,164 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +[ + { + "site-id": ${prop.l3vpn.site1_name}, + "vpn-policies": { + "vpn-policy": [ + { + "vpn-policy-id": ${prop.l3vpn.vpn-policy1-id}, + "entries": [ + { + "id": ${prop.l3vpn.entry1-id}, + "vpn": { + "vpn-id": ${prop.l3vpn.name}, + "site-role": "huawei-ac-net-l3vpn-svc:any-to-any-role" + } + } + ] + } + ] + }, + "site-network-accesses": { + "site-network-access": [ + { + "site-network-access-id": ${prop.l3vpn.sna1_name}, + "bearer": { + "appointed-access": { + "ne-id": ${prop.l3vpn.pe1_id}, + "ltp-id": ${prop.l3vpn.ac1_id}, + "vlan": { + "type": "huawei-ac-net-l3vpn-svc:vlan-dot1q", + "vlan-id": ${prop.l3vpn.sna1_svlan} + } + } + }, + "ip-connection": { + "ipv4": { + "address-allocation-type": "huawei-ac-net-l3vpn-svc:static-address", + "addresses": { + "provider-address": ${prop.l3vpn.ac1-peer-ip}, + "customer-address": ${prop.l3vpn.ac1-ip}, + "mask": "24" + } + } + }, + "service": { + "mtu": "1500" + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "huawei-ac-net-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": [ + { + "ipv4-lan-prefixes": [ + { + "ip-prefix": ${prop.l3vpn.sna1-route}, + "next-hop": ${prop.l3vpn.sna1-route} + } + ] + } + ] + } + } + ] + }, + "vpn-attachment": { + "vpn-policy-id": ${prop.l3vpn.name} + } + } + ] + }, + { + "site-id": ${prop.l3vpn.site2_name}, + "vpn-policies": { + "vpn-policy": [ + { + "vpn-policy-id": ${prop.l3vpn.vpn-policy2-id}, + "entries": [ + { + "id": ${prop.l3vpn.entry2-id}, + "vpn": { + "vpn-id": ${prop.l3vpn.name}, + "site-role": "huawei-ac-net-l3vpn-svc:any-to-any-role" + } + } + ] + } + ] + }, + "site-network-accesses": { + "site-network-access": [ + { + "site-network-access-id": ${prop.l3vpn.sna2_name}, + "bearer": { + "appointed-access": { + "ne-id": ${prop.l3vpn.pe2_id}, + "ltp-id": ${prop.l3vpn.ac2_id}, + "vlan": { + "type": "huawei-ac-net-l3vpn-svc:vlan-dot1q", + "vlan-id": ${prop.l3vpn.sna2_svlan} + } + } + }, + "ip-connection": { + "ipv4": { + "address-allocation-type": "huawei-ac-net-l3vpn-svc:static-address", + "addresses": { + "provider-address": ${prop.l3vpn.ac2-peer-ip}, + "customer-address": ${prop.l3vpn.ac2-ip}, + "mask": "24" + } + } + }, + "service": { + "mtu": "1500" + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "huawei-ac-net-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": [ + { + "ipv4-lan-prefixes": [ + { + "ip-prefix": ${prop.l3vpn.sna2-route}, + "next-hop": ${prop.l3vpn.sna2-route} + } + ] + } + ] + } + } + ] + }, + "vpn-attachment": { + "vpn-policy-id": ${prop.l3vpn.name} + } + } + ] + } +] + diff --git a/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json b/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json new file mode 100644 index 000000000..c0a7c1922 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "vpn-id": ${prop.l3vpn.name}, + "customer-name": "huawei", + "vpn-service-topology": ${prop.l3vpn.topology}, + "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way" +} + -- cgit 1.2.3-korg From ebd6ab052a5fcd84522f3daff88b197e46a068c8 Mon Sep 17 00:00:00 2001 From: 黄卓垚10112215 Date: Thu, 28 Sep 2017 14:34:15 +0800 Subject: SPTN l3vpn template Change-Id: I3349a43e2dbd8948fbc5573a6c064c45e7a443de Issue-ID: SDNC-91 Signed-off-by: Zhuoyao Huang <10112215@zte.com.cn> --- .../src/main/resources/sptn-l3vpn-template.json | 180 +++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 restapi-call-node/provider/src/main/resources/sptn-l3vpn-template.json (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/resources/sptn-l3vpn-template.json b/restapi-call-node/provider/src/main/resources/sptn-l3vpn-template.json new file mode 100644 index 000000000..9e1e92068 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/sptn-l3vpn-template.json @@ -0,0 +1,180 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "snc-l3vpn": { + "-xmlns": "urn:chinamobile:l3vpn", + "operate-status": "operate-up", + "traffic-class": "BE", + "acs": { + "l3-acs": [ + { + "id": "0", + "ne-id": ${prop.l3vpn.pe1_id}, + "ltp-id": ${prop.l3vpn.ac1_id}, + "ip-addr": ${prop.l3vpn.ac1_ip.value}, + "ip-mask": ${prop.l3vpn.ac1_ip.mask}, + "access-type": "Sub-interface", + "vlan": ${prop.l3vpn.ac1_svlan}, + "qos": { + "belonged-id": ${prop.l3vpn.ac1_id}, + "tunnel-mode": "pipeline", + "cac-mode": "1", + "convg-mode": "0", + "traffic-adj-mode": "0", + "a2z-policing": "1", + "z2a-policing": "1", + "a2z-cir": "5000", + "z2a-cir": "5000", + "a2z-pir": "1000000", + "z2a-pir": "1000000", + "a2z-cbs": "1024", + "z2a-cbs": "1024", + "a2z-pbs": "1024", + "z2a-pbs": "1024", + "a2z-color-mode": "0", + "z2a-color-mode": "0", + "traffic-class": "CS7" + }, + "protocol-list": { + "protocols": { + "protocol-type": "static", + "static-route-list": { + "static-routes": [ + { + "id": "0", + "dest-ip": ${prop.l3vpn.ac1_peer_ip.value}, + "dest-mask": ${prop.l3vpn.ac1_peer_ip.mask}, + "route-type": "direct-route", + "out-inf": ${prop.l3vpn.ac1_id}, + "route-weight": "3", + "route-status": "up" + } + ] + } + } + } + }, + { + "id": "1", + "ne-id": ${prop.l3vpn.pe2_id}, + "ltp-id": ${prop.l3vpn.ac2_id}, + "ip-addr": ${prop.l3vpn.ac2_ip.value}, + "ip-mask": ${prop.l3vpn.ac2_ip.mask}, + "access-type": "Sub-interface", + "vlan": ${prop.l3vpn.ac1_svlan}, + "qos": { + "belonged-id": ${prop.l3vpn.ac2_id}, + "tunnel-mode": "pipeline", + "cac-mode": "1", + "convg-mode": "0", + "traffic-adj-mode": "0", + "a2z-policing": "1", + "z2a-policing": "1", + "a2z-cir": "5000", + "z2a-cir": "5000", + "a2z-pir": "1000000", + "z2a-pir": "1000000", + "a2z-cbs": "1024", + "z2a-cbs": "1024", + "a2z-pbs": "1024", + "z2a-pbs": "1024", + "a2z-color-mode": "0", + "z2a-color-mode": "0", + "traffic-class": "CS7" + }, + "protocol-list": { + "protocols": { + "protocol-type": "static", + "static-route-list": { + "static-routes": [ + { + "id": "0", + "dest-ip": ${prop.l3vpn.ac2_peer_ip.value}, + "dest-mask": ${prop.l3vpn.ac2_peer_ip.mask}, + "route-type": "direct-route", + "out-inf": ${prop.l3vpn.ac2_id}, + "route-weight": "4", + "route-status": "up" + } + ] + } + } + } + } + ] + }, + "user-label": ${prop.l3vpn.name}, + "topo-mode": "any-to-any", + "admin-status": "admin-up", + "tunnel-create-policy": { + "user-label": "tunnel", + "tenant-id": "tunnel", + "direction": "bidirection", + "type": "1", + "admin-status": "admin-up", + "qos": { + "tunnel-mode": "pipeline", + "cac-mode": "1", + "convg-mode": "0", + "traffic-adj-mode": "0", + "a2z-policing": "0", + "a2z-cir": "500", + "a2z-pir": "1000000", + "a2z-cbs": "1024", + "a2z-pbs": "1024", + "a2z-color-mode": "0", + "z2a-policing": "0", + "z2a-cir": "500", + "z2a-pir": "1000000", + "z2a-cbs": "1024", + "z2a-pbs": "1024", + "z2a-color-mode": "0", + "traffic-class": "CS7" + }, + "snc-switch": { + "layer-rate": "LSP", + "linear-protection-type": "path-protection-1-to-1", + "linear-protection-protocol": "APS", + "switch-mode": "double-end-switch", + "revertive-mode": "revertive", + "wtr": "60", + "hold-off-time": "0", + "reroute-revertive-mode": "revertive", + "reroute-wtr": "50" + }, + "lsp-oam": { + "cc-allow": "true", + "cc-exp": "CS7", + "cc-interval": "3.3", + "lm-mode": "preactive", + "dm-mode": "preactive", + "meps": { + "mep": [ + { "id": "1" }, + { "id": "2" } + ] + } + } + } + } +} + -- cgit 1.2.3-korg From 59f762556c4cecf8f59e780f6dd5072d85ccabfe Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Thu, 28 Sep 2017 15:20:37 +0530 Subject: Added l2-dci json template and updated l3-dci Following changes are included: 1) Added l2-dci template 2) Updated l3-dci template to handle paramaters generically for l2 and l3 3) Leaf-List handling 4) Added testcases for l2 and l3 template. Change-Id: I3142ae35286ea3c55927bedf5a071aaff5b15401 Issue-Id: SDNC-103 Signed-off-by: Gaurav Agrawal --- .../main/resources/l2-dci-connects-template.json | 29 +++++++++++ .../main/resources/l3-dci-connects-template.json | 16 +++--- .../plugins/restapicall/TestRestapiCallNode.java | 57 +++++++++++++++++++++- .../test/resources/l2-dci-connects-template.json | 29 +++++++++++ .../test/resources/l3-dci-connects-template.json | 34 +++++++++++++ 5 files changed, 156 insertions(+), 9 deletions(-) create mode 100644 restapi-call-node/provider/src/main/resources/l2-dci-connects-template.json create mode 100644 restapi-call-node/provider/src/test/resources/l2-dci-connects-template.json create mode 100644 restapi-call-node/provider/src/test/resources/l3-dci-connects-template.json (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/resources/l2-dci-connects-template.json b/restapi-call-node/provider/src/main/resources/l2-dci-connects-template.json new file mode 100644 index 000000000..f18075686 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/l2-dci-connects-template.json @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "l2-dci-connect": { + "id": ${prop.dci-connects.id}, + "name": ${prop.dci-connects.name}, + "description": ${prop.dci-connects.description}, + "network_id": ${prop.dci-connects.local_networks[0]}, + "evpn_irts": ${prop.dci-connects.evpn_irts}, + "evpn_erts": ${prop.dci-connects.evpn_erts}, + "vni": ${prop.dci-connects.vni} + } +} diff --git a/restapi-call-node/provider/src/main/resources/l3-dci-connects-template.json b/restapi-call-node/provider/src/main/resources/l3-dci-connects-template.json index 3f0e20304..c011b077b 100644 --- a/restapi-call-node/provider/src/main/resources/l3-dci-connects-template.json +++ b/restapi-call-node/provider/src/main/resources/l3-dci-connects-template.json @@ -20,15 +20,15 @@ { "l3-dci-connect": { - "id": "${prop.l3-dci-connects.id}", - "name": "${prop.l3-dci-connects.name}", - "description": "${prop.l3-dci-connects.description}", - "router_id": "${prop.l3-dci-connects.router_id}", + "id": ${prop.dci-connects.id}, + "name": ${prop.dci-connects.name}, + "description": ${prop.dci-connects.description}, + "router_id": ${prop.dci-connects.router_id}, "firewall_enable": false, - "local_networks": ["${prop.l3-dci-connects.local_networks}"], + "local_networks": ${prop.dci-connects.local_networks}, "local_network_all": false, - "evpn_irts": ["${prop.l3-dci-connects.evpn_irts}"], - "evpn_erts": ["${prop.l3-dci-connects.evpn_erts}"], - "l3_vni": "${prop.l3-dci-connects.l3_vni}" + "evpn_irts": ${prop.dci-connects.evpn_irts}, + "evpn_erts": ${prop.dci-connects.evpn_erts}, + "l3_vni": ${prop.dci-connects.vni} } } diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 2d3b40105..1dcc97bca 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -23,7 +23,6 @@ package jtest.org.onap.ccsdk.sli.plugins.restapicall; import java.util.HashMap; import java.util.Map; - import org.junit.Test; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; @@ -255,4 +254,60 @@ public class TestRestapiCallNode { RestapiCallNode rcn = new RestapiCallNode(); rcn.sendRequest(p, ctx); } + + @Test + public void testL2DciTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.dci-connects.id", "Id1"); + ctx.setAttribute("prop.dci-connects.name", "Name1"); + ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); + ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); + ctx.setAttribute("prop.dci-connects.vni", "1"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l2-dci-connects-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testL3DciTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.dci-connects.id", "Id1"); + ctx.setAttribute("prop.dci-connects.name", "Name1"); + ctx.setAttribute("prop.dci-connects.local_networks_length", "2"); + ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); + ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); + ctx.setAttribute("prop.dci-connects.vni", "1"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3-dci-connects-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + + } } diff --git a/restapi-call-node/provider/src/test/resources/l2-dci-connects-template.json b/restapi-call-node/provider/src/test/resources/l2-dci-connects-template.json new file mode 100644 index 000000000..f18075686 --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/l2-dci-connects-template.json @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "l2-dci-connect": { + "id": ${prop.dci-connects.id}, + "name": ${prop.dci-connects.name}, + "description": ${prop.dci-connects.description}, + "network_id": ${prop.dci-connects.local_networks[0]}, + "evpn_irts": ${prop.dci-connects.evpn_irts}, + "evpn_erts": ${prop.dci-connects.evpn_erts}, + "vni": ${prop.dci-connects.vni} + } +} diff --git a/restapi-call-node/provider/src/test/resources/l3-dci-connects-template.json b/restapi-call-node/provider/src/test/resources/l3-dci-connects-template.json new file mode 100644 index 000000000..c011b077b --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/l3-dci-connects-template.json @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Copyright (C) 2017 Intel Corp. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "l3-dci-connect": { + "id": ${prop.dci-connects.id}, + "name": ${prop.dci-connects.name}, + "description": ${prop.dci-connects.description}, + "router_id": ${prop.dci-connects.router_id}, + "firewall_enable": false, + "local_networks": ${prop.dci-connects.local_networks}, + "local_network_all": false, + "evpn_irts": ${prop.dci-connects.evpn_irts}, + "evpn_erts": ${prop.dci-connects.evpn_erts}, + "l3_vni": ${prop.dci-connects.vni} + } +} -- cgit 1.2.3-korg From 02c63c550acb82bee8d360c01bb1723b10f8df9a Mon Sep 17 00:00:00 2001 From: "ramu.n" Date: Fri, 29 Sep 2017 06:32:52 +0530 Subject: Update VoLTE underlay JSON template *Add vrf-attribute configuration *Add BGP protocol type for ac Change-Id: I6deb5b4ec6d71b18e8d6b67aadaba18b7a27c47b Issue-Id: SDNC-108 Signed-off-by: Ramu N --- .../src/main/resources/l3smsitetemplate.json | 31 ++++++++++++++----- .../src/main/resources/l3smvpntemplate.json | 15 ++++++---- .../src/main/resources/l3smvrftemplate.json | 35 ++++++++++++++++++++++ .../plugins/restapicall/TestRestapiCallNode.java | 33 ++++++++++++++++++-- .../src/test/resources/l3smsitetemplate.json | 31 ++++++++++++++----- .../src/test/resources/l3smvpntemplate.json | 15 ++++++---- .../src/test/resources/l3smvrftemplate.json | 35 ++++++++++++++++++++++ 7 files changed, 167 insertions(+), 28 deletions(-) create mode 100644 restapi-call-node/provider/src/main/resources/l3smvrftemplate.json create mode 100644 restapi-call-node/provider/src/test/resources/l3smvrftemplate.json (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json b/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json index e7b569289..3aa426be7 100644 --- a/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json +++ b/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * openECOMP : SDN-C + * ONAP : SDN-C * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. @@ -68,19 +68,28 @@ "routing-protocols": { "routing-protocol": [ { - "type": "huawei-ac-net-l3vpn-svc:static", + "type": ${prop.l3vpn.ac1_protocol}, "static": { "cascaded-lan-prefixes": [ { "ipv4-lan-prefixes": [ { - "ip-prefix": ${prop.l3vpn.sna1-route}, - "next-hop": ${prop.l3vpn.sna1-route} + "ip-prefix": ${prop.l3vpn.sna1-route.ip-prefix}, + "next-hop": ${prop.l3vpn.sna1-route.next-hop} } ] } ] } + "bgp": { + "peers": [ + { + "peer-ip": ${prop.l3vpn.peer1-ip}, + "remote-as": ${prop.l3vpn.ac1_protocol_bgp_as} + } + ] + } + } } ] }, @@ -138,19 +147,27 @@ "routing-protocols": { "routing-protocol": [ { - "type": "huawei-ac-net-l3vpn-svc:static", + "type": ${prop.l3vpn.ac2_protocol}, "static": { "cascaded-lan-prefixes": [ { "ipv4-lan-prefixes": [ { - "ip-prefix": ${prop.l3vpn.sna2-route}, - "next-hop": ${prop.l3vpn.sna2-route} + "ip-prefix": ${prop.l3vpn.sna2-route.ip-prefix}, + "next-hop": ${prop.l3vpn.sna2-route.next-hop} } ] } ] } + "bgp": { + "peers": [ + { + "peer-ip": ${prop.l3vpn.peer2-ip}, + "remote-as": ${prop.l3vpn.ac2_protocol_bgp_as} + } + ] + } } ] }, diff --git a/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json b/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json index c0a7c1922..c0d135310 100644 --- a/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json +++ b/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * openECOMP : SDN-C + * ONAP : SDN-C * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. @@ -20,9 +20,12 @@ */ { - "vpn-id": ${prop.l3vpn.name}, - "customer-name": "huawei", - "vpn-service-topology": ${prop.l3vpn.topology}, - "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way" + "vpn-service": [ + { + "vpn-id": ${prop.l3vpn.name, + "customer-name": "huawei", + "vpn-service-topology": ${prop.l3vpn.topology, + "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way" + } + ] } - diff --git a/restapi-call-node/provider/src/main/resources/l3smvrftemplate.json b/restapi-call-node/provider/src/main/resources/l3smvrftemplate.json new file mode 100644 index 000000000..732af278c --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/l3smvrftemplate.json @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "vrf-attribute": [ + { + "vrf-attribute-id": ${prop.l3vpn.vrf1-id}, + "ne-id": ${prop.l3vpn.pe1_id}, + "vpn-policy-id": ${prop.l3vpn.vpn-policy1-id} + }, + { + "vrf-attribute-id": ${prop.l3vpn.vrf2-id}, + "ne-id": ${prop.l3vpn.pe2_id}, + "vpn-policy-id": ${prop.l3vpn.vpn-policy2-id} + } + ] +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 1dcc97bca..2c2bde0f4 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -23,6 +23,7 @@ package jtest.org.onap.ccsdk.sli.plugins.restapicall; import java.util.HashMap; import java.util.Map; + import org.junit.Test; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; @@ -229,7 +230,9 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b"); ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1"); ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2"); - ctx.setAttribute("prop.l3vpn.sna1-route", "192.168.1.4/24"); + ctx.setAttribute("prop.l3vpn.ac1_protocol", "static"); + ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24"); + ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4"); ctx.setAttribute("prop.l3vpn.site2_name", "10000000-0000-0000-0000-000000000005"); ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); @@ -239,7 +242,9 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c"); ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.5"); ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5"); - ctx.setAttribute("prop.l3vpn.sna2-route", "192.168.1.8/24"); + ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp"); + ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.5"); + ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200"); Map p = new HashMap(); p.put("templateFileName", "src/test/resources/l3smsitetemplate.json"); @@ -255,6 +260,30 @@ public class TestRestapiCallNode { rcn.sendRequest(p, ctx); } + @Test + public void testVrfJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.vrf1-id", "10000000-0000-0000-0000-000000000007"); + ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); + ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); + ctx.setAttribute("prop.l3vpn.vrf2-id", "10000000-0000-0000-0000-000000000009"); + ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); + ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smvrftemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vrf-attributes"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + @Test public void testL2DciTemplate() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); diff --git a/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json b/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json index e7b569289..3aa426be7 100644 --- a/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json +++ b/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * openECOMP : SDN-C + * ONAP : SDN-C * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. @@ -68,19 +68,28 @@ "routing-protocols": { "routing-protocol": [ { - "type": "huawei-ac-net-l3vpn-svc:static", + "type": ${prop.l3vpn.ac1_protocol}, "static": { "cascaded-lan-prefixes": [ { "ipv4-lan-prefixes": [ { - "ip-prefix": ${prop.l3vpn.sna1-route}, - "next-hop": ${prop.l3vpn.sna1-route} + "ip-prefix": ${prop.l3vpn.sna1-route.ip-prefix}, + "next-hop": ${prop.l3vpn.sna1-route.next-hop} } ] } ] } + "bgp": { + "peers": [ + { + "peer-ip": ${prop.l3vpn.peer1-ip}, + "remote-as": ${prop.l3vpn.ac1_protocol_bgp_as} + } + ] + } + } } ] }, @@ -138,19 +147,27 @@ "routing-protocols": { "routing-protocol": [ { - "type": "huawei-ac-net-l3vpn-svc:static", + "type": ${prop.l3vpn.ac2_protocol}, "static": { "cascaded-lan-prefixes": [ { "ipv4-lan-prefixes": [ { - "ip-prefix": ${prop.l3vpn.sna2-route}, - "next-hop": ${prop.l3vpn.sna2-route} + "ip-prefix": ${prop.l3vpn.sna2-route.ip-prefix}, + "next-hop": ${prop.l3vpn.sna2-route.next-hop} } ] } ] } + "bgp": { + "peers": [ + { + "peer-ip": ${prop.l3vpn.peer2-ip}, + "remote-as": ${prop.l3vpn.ac2_protocol_bgp_as} + } + ] + } } ] }, diff --git a/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json b/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json index c0a7c1922..c0d135310 100644 --- a/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json +++ b/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * openECOMP : SDN-C + * ONAP : SDN-C * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. @@ -20,9 +20,12 @@ */ { - "vpn-id": ${prop.l3vpn.name}, - "customer-name": "huawei", - "vpn-service-topology": ${prop.l3vpn.topology}, - "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way" + "vpn-service": [ + { + "vpn-id": ${prop.l3vpn.name, + "customer-name": "huawei", + "vpn-service-topology": ${prop.l3vpn.topology, + "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way" + } + ] } - diff --git a/restapi-call-node/provider/src/test/resources/l3smvrftemplate.json b/restapi-call-node/provider/src/test/resources/l3smvrftemplate.json new file mode 100644 index 000000000..732af278c --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/l3smvrftemplate.json @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "vrf-attribute": [ + { + "vrf-attribute-id": ${prop.l3vpn.vrf1-id}, + "ne-id": ${prop.l3vpn.pe1_id}, + "vpn-policy-id": ${prop.l3vpn.vpn-policy1-id} + }, + { + "vrf-attribute-id": ${prop.l3vpn.vrf2-id}, + "ne-id": ${prop.l3vpn.pe2_id}, + "vpn-policy-id": ${prop.l3vpn.vpn-policy2-id} + } + ] +} -- cgit 1.2.3-korg From 2f8f9b58913ad1aa11838680857a1148a8b72bb3 Mon Sep 17 00:00:00 2001 From: "ramu.n" Date: Wed, 11 Oct 2017 14:35:39 +0530 Subject: Update underlay JSON template for VoLTE use case Fix closing braces in l3smvpntemplate.json file Change-Id: I1c891d46591f184a9cc89ca3d15b3046932ab05f Issue-Id: SDNC-108 Signed-off-by: Ramu N --- restapi-call-node/provider/src/main/resources/l3smvpntemplate.json | 4 ++-- restapi-call-node/provider/src/test/resources/l3smvpntemplate.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json b/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json index c0d135310..67f127ce9 100644 --- a/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json +++ b/restapi-call-node/provider/src/main/resources/l3smvpntemplate.json @@ -22,9 +22,9 @@ { "vpn-service": [ { - "vpn-id": ${prop.l3vpn.name, + "vpn-id": ${prop.l3vpn.name}, "customer-name": "huawei", - "vpn-service-topology": ${prop.l3vpn.topology, + "vpn-service-topology": ${prop.l3vpn.topology}, "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way" } ] diff --git a/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json b/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json index c0d135310..67f127ce9 100644 --- a/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json +++ b/restapi-call-node/provider/src/test/resources/l3smvpntemplate.json @@ -22,9 +22,9 @@ { "vpn-service": [ { - "vpn-id": ${prop.l3vpn.name, + "vpn-id": ${prop.l3vpn.name}, "customer-name": "huawei", - "vpn-service-topology": ${prop.l3vpn.topology, + "vpn-service-topology": ${prop.l3vpn.topology}, "route-exchange-policy": "huawei-ac-net-l3vpn-svc:vpnv4-way" } ] -- cgit 1.2.3-korg From 3cc6cc194791d9eedfe87fd671ee0db3e8e72897 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Thu, 12 Oct 2017 13:40:39 +0530 Subject: Remove null check *Move string literal to the left side of comparison Null check is performed by String.equalsIgnorecase hence removed Issue-Id: CCSDK-117 Change-Id: I48c8815f9f20a1c6e86c8b4af8966c9945d5b0c7 Signed-off-by: surya-huawei --- .../main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java index 573c85f78..776485afa 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java @@ -25,11 +25,9 @@ public enum Format { JSON, XML; public static Format fromString(String s) { - if (s == null) - return null; - if (s.equalsIgnoreCase("json")) + if ("json".equalsIgnoreCase(s)) return JSON; - if (s.equalsIgnoreCase("xml")) + if ("xml".equalsIgnoreCase(s)) return XML; throw new IllegalArgumentException("Invalid value for format: " + s); } -- cgit 1.2.3-korg From 85e0df60352d2ffa7e63a5a5e570f12cb0b081f4 Mon Sep 17 00:00:00 2001 From: "ramu.n" Date: Fri, 13 Oct 2017 16:18:50 +0530 Subject: Update VoLTE underlay JSON template *Fix missing site element in l3smsitetemplate.json file *Add UT test case delete L3VPN Change-Id: Iee56d30746328e8f094a5c45c6e2e577b6989bf9 Issue-Id: SDNC-108 Signed-off-by: Ramu N --- .../src/main/resources/l3smsitetemplate.json | 6 ++++-- .../plugins/restapicall/TestRestapiCallNode.java | 23 +++++++++++++++++++++- .../src/test/resources/l3smsitetemplate.json | 6 ++++-- 3 files changed, 30 insertions(+), 5 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json b/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json index 3aa426be7..016879c3c 100644 --- a/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json +++ b/restapi-call-node/provider/src/main/resources/l3smsitetemplate.json @@ -19,7 +19,8 @@ * ============LICENSE_END========================================================= */ -[ +{ + "site":[ { "site-id": ${prop.l3vpn.site1_name}, "vpn-policies": { @@ -177,5 +178,6 @@ } ] } -] + ] +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 2c2bde0f4..a84d1509e 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -283,7 +283,28 @@ public class TestRestapiCallNode { RestapiCallNode rcn = new RestapiCallNode(); rcn.sendRequest(p, ctx); } - + + @Test + public void testDeleteVpnJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap(); + //p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services" + + "/vpnservice=10000000-0000-0000-0000-000000000001"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "delete"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + @Test public void testL2DciTemplate() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); diff --git a/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json b/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json index 3aa426be7..016879c3c 100644 --- a/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json +++ b/restapi-call-node/provider/src/test/resources/l3smsitetemplate.json @@ -19,7 +19,8 @@ * ============LICENSE_END========================================================= */ -[ +{ + "site":[ { "site-id": ${prop.l3vpn.site1_name}, "vpn-policies": { @@ -177,5 +178,6 @@ } ] } -] + ] +} -- cgit 1.2.3-korg From ba4ef5baf9a3661aa4c55d06a38b62b8bb0a00b4 Mon Sep 17 00:00:00 2001 From: "ramu.n" Date: Tue, 17 Oct 2017 21:08:02 +0530 Subject: Add JSON template for VoLTE use case *For ipwan controller first need to get authentication token and add to customHttpHeaders Change-Id: I7be6e75f9712bc2214ee4a1804189162675c8a25 Issue-Id: SDNC-131 Signed-off-by: Ramu N --- .../src/main/resources/actokentemplate.json | 25 ++++++++++++++++++++++ .../plugins/restapicall/TestRestapiCallNode.java | 24 +++++++++++++++++++-- .../src/test/resources/actokentemplate.json | 25 ++++++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 restapi-call-node/provider/src/main/resources/actokentemplate.json create mode 100644 restapi-call-node/provider/src/test/resources/actokentemplate.json (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/resources/actokentemplate.json b/restapi-call-node/provider/src/main/resources/actokentemplate.json new file mode 100644 index 000000000..31bf0ee2b --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/actokentemplate.json @@ -0,0 +1,25 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "userName": ${prop.sdncRestApi.thirdpartySdnc.user}, + "password": ${prop.sdncRestApi.thirdpartySdnc.password} +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index a84d1509e..2da5b2c83 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -230,6 +230,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b"); ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1"); ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2"); + ctx.setAttribute("prop.l3vpn.sna1_svlan", "100"); ctx.setAttribute("prop.l3vpn.ac1_protocol", "static"); ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24"); ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4"); @@ -240,10 +241,11 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.l3vpn.sna2_name", "10000000-0000-0000-0000-000000000007"); ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c"); - ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.5"); + ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.6"); ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5"); + ctx.setAttribute("prop.l3vpn.sna2_svlan", "200"); ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp"); - ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.5"); + ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.7"); ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200"); Map p = new HashMap(); @@ -360,4 +362,22 @@ public class TestRestapiCallNode { rcn.sendRequest(p, ctx); } + + @Test + public void testControllerTokenTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.user", "admin"); + ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.password", "admin123"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/actokentemplate.json"); + p.put("restapiUrl", "https://ipwan:18002/controller/v2/tokens"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } } diff --git a/restapi-call-node/provider/src/test/resources/actokentemplate.json b/restapi-call-node/provider/src/test/resources/actokentemplate.json new file mode 100644 index 000000000..31bf0ee2b --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/actokentemplate.json @@ -0,0 +1,25 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "userName": ${prop.sdncRestApi.thirdpartySdnc.user}, + "password": ${prop.sdncRestApi.thirdpartySdnc.password} +} -- cgit 1.2.3-korg From eff81fd8cbdcb6dabd3b9d41a1d2659ccd57f2f9 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 9 Nov 2017 07:21:42 -0500 Subject: Roll to version 0.1.1-SNAPSHOT Roll to next release version Change-Id: I3d10e4d8e35c844f4eac305332b160cdb533efc3 Issue-ID: CCSDK-141 Signed-off-by: Dan Timoney --- pom.xml | 2 +- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- version.properties | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index a5c349fcb..c1ed06be4 100755 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,7 @@ AT&T - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 5573d1e7a..8ed9601f8 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -4,10 +4,10 @@ properties-node org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT properties-node-features Properties Node - Features diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 570eced79..b00a7e5a2 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ properties-node org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT properties-node-installer Properties node - Karaf Installer diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 1f860b70e..c85160794 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -3,7 +3,7 @@ org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT 4.0.0 @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins properties-node - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT Properties Node This is an implementation of DG Execute Node that reads property file and diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index a5249d98b..b73456815 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -4,10 +4,10 @@ org.onap.ccsdk.sli.plugins properties-node - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT properties-node-provider bundle Properties Node - Provider diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 93ee00373..5528bb6b1 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -4,10 +4,10 @@ restapi-call-node org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT restapi-call-node-features RESTAPI Call Node - Features diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 9fa4496a1..724534759 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ restapi-call-node org.onap.ccsdk.sli.plugins - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT restapi-call-node-installer Properties node - Karaf Installer diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index b819e47e9..9d266cead 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -3,7 +3,7 @@ org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT 4.0.0 @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT RESTAPI Call Node This is an implementation of DG Execute Node that makes a call to an external REST API diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index ca3f004a0..5af32b642 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -4,11 +4,11 @@ org.onap.ccsdk.sli.plugins restapi-call-node - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.1.0-SNAPSHOT + 0.1.1-SNAPSHOT bundle RESTAPI Call Node - Provider http://maven.apache.org diff --git a/version.properties b/version.properties index a9acb2876..948004231 100644 --- a/version.properties +++ b/version.properties @@ -7,7 +7,7 @@ release_name=0 sprint_number=1 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 17a92cb09deea9704ca2b12beec3450ee1f89a65 Mon Sep 17 00:00:00 2001 From: Jessica Wagantall Date: Fri, 17 Nov 2017 16:59:31 -0800 Subject: Bump minor version Bump minor version in preparation for Amsterdam branching. Change-Id: I514e87be3f1291a1fa8bf9e9afb3a10066d71779 Issue-ID: CIMAN-120 Signed-off-by: Jessica Wagantall --- pom.xml | 2 +- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index c1ed06be4..cf84ab7ae 100755 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,7 @@ AT&T - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 8ed9601f8..0f1e662d9 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -4,10 +4,10 @@ properties-node org.onap.ccsdk.sli.plugins - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT properties-node-features Properties Node - Features diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index b00a7e5a2..8a3330a8f 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ properties-node org.onap.ccsdk.sli.plugins - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT properties-node-installer Properties node - Karaf Installer diff --git a/properties-node/pom.xml b/properties-node/pom.xml index c85160794..ea03a6423 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -3,7 +3,7 @@ org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT 4.0.0 @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins properties-node - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT Properties Node This is an implementation of DG Execute Node that reads property file and diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index b73456815..d622e59e9 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -4,10 +4,10 @@ org.onap.ccsdk.sli.plugins properties-node - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT properties-node-provider bundle Properties Node - Provider diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 5528bb6b1..41af12507 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -4,10 +4,10 @@ restapi-call-node org.onap.ccsdk.sli.plugins - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT restapi-call-node-features RESTAPI Call Node - Features diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 724534759..aedb3b705 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ restapi-call-node org.onap.ccsdk.sli.plugins - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT restapi-call-node-installer Properties node - Karaf Installer diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 9d266cead..d48253e08 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -3,7 +3,7 @@ org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT 4.0.0 @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT RESTAPI Call Node This is an implementation of DG Execute Node that makes a call to an external REST API diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 5af32b642..0d6b3fb86 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -4,11 +4,11 @@ org.onap.ccsdk.sli.plugins restapi-call-node - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.1.1-SNAPSHOT + 0.2.0-SNAPSHOT bundle RESTAPI Call Node - Provider http://maven.apache.org -- cgit 1.2.3-korg From ad7ea1271a5eb1bb56b48a2fb1b35d8ddfed2d12 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 27 Feb 2018 13:34:16 -0500 Subject: Nitrogen port : sli/plugins Update properties-node and restapi-call-node to compile against ODL Nitrogen Change-Id: I21f06abb008562d6e351cb780302ed4375f5d3d2 Issue-ID: CCSDK-178 Signed-off-by: Dan Timoney --- pom.xml | 115 ++++++++--------- .../features/ccsdk-properties-node/pom.xml | 44 +++++++ .../features/features-properties-node/pom.xml | 29 +++++ properties-node/features/pom.xml | 137 ++------------------ .../features/src/main/resources/features.xml | 39 ------ properties-node/installer/pom.xml | 30 +++-- .../src/main/resources/scripts/install-feature.sh | 9 +- properties-node/pom.xml | 36 ++---- properties-node/provider/pom.xml | 68 ++-------- .../META-INF/spring/properties-node-context.xml | 32 ----- .../spring/properties-node-osgi-context.xml | 32 ----- .../blueprint/properties-node-blueprint.xml | 16 +++ .../features/ccsdk-restapi-call-node/pom.xml | 53 ++++++++ .../features/features-restapi-call-node/pom.xml | 29 +++++ restapi-call-node/features/pom.xml | 143 +++------------------ restapi-call-node/installer/pom.xml | 39 +++--- .../src/main/resources/scripts/install-feature.sh | 9 +- restapi-call-node/pom.xml | 36 ++---- restapi-call-node/provider/pom.xml | 56 ++------ 19 files changed, 339 insertions(+), 613 deletions(-) create mode 100644 properties-node/features/ccsdk-properties-node/pom.xml create mode 100644 properties-node/features/features-properties-node/pom.xml delete mode 100644 properties-node/features/src/main/resources/features.xml delete mode 100644 properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml delete mode 100644 properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml create mode 100755 properties-node/provider/src/main/resources/org/opendaylight/blueprint/properties-node-blueprint.xml create mode 100644 restapi-call-node/features/ccsdk-restapi-call-node/pom.xml create mode 100644 restapi-call-node/features/features-restapi-call-node/pom.xml (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index cf84ab7ae..0a01af400 100755 --- a/pom.xml +++ b/pom.xml @@ -1,27 +1,29 @@ - + + 4.0.0 org.onap.ccsdk.parent - odlparent-carbon-sr1 - 0.1.0 + odlparent-lite + 1.0.1-SNAPSHOT - 4.0.0 - pom org.onap.ccsdk.sli.plugins ccsdk-sli-plugins + 0.2.1-SNAPSHOT + pom ccsdk-sli-plugins - https://wiki.onap.org CCSDK Java Plugins + https://wiki.onap.org + + ONAP + - - - JIRA - https://jira.onap.org/ - - + + properties-node + restapi-call-node + scm:git:ssh://git@${onap.git.host}/ccsdk/sli/plugins.git @@ -29,13 +31,14 @@ ${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/ccsdk/sli/plugins/browse HEAD - + + JIRA + https://jira.onap.org/ + Jenkins https://jenkins.onap.org - - sdnc-javadoc @@ -43,43 +46,6 @@ - - - blackduck - - - blackduck-scan - - - - - - com.blackducksoftware.integration - hub-maven-plugin - 1.4.0 - false - - ${project.name} - ${project.basedir} - - - - create-bdio-file - package - - createHubOutput - - - - - - - - - - - - @@ -102,16 +68,43 @@ - - - properties-node - restapi-call-node - - - AT&T - - 0.2.0-SNAPSHOT + + + blackduck + + + blackduck-scan + + + + + + com.blackducksoftware.integration + hub-maven-plugin + 1.4.0 + false + + ${project.name} + ${project.basedir} + + + + create-bdio-file + package + + createHubOutput + + + + + + + + + + + diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml new file mode 100644 index 000000000..992e1099b --- /dev/null +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.plugins + ccsdk-properties-node + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-plugins :: properties-node :: ${project.artifactId} + + + true + + + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + properties-node-provider + ${project.version} + + + + diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml new file mode 100644 index 000000000..b39826221 --- /dev/null +++ b/properties-node/features/features-properties-node/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.plugins + features-properties-node + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-plugins :: properties-node :: ${project.artifactId} + + + + ${project.groupId} + ccsdk-properties-node + ${project.version} + xml + features + + + + diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 0f1e662d9..0d4476585 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -1,135 +1,22 @@ 4.0.0 + - properties-node - org.onap.ccsdk.sli.plugins - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + org.onap.ccsdk.sli.plugins - 0.2.0-SNAPSHOT properties-node-features - Properties Node - Features - - jar - - - - - org.onap.ccsdk.sli.plugins - properties-node-provider - ${project.version} - - - - commons-lang - commons-lang - 2.6 - compile - - - - org.opendaylight.mdsal - features-mdsal - ${odl.mdsal.features.version} - features - xml - - runtime - - - - - - org.opendaylight.controller - opendaylight-karaf-empty - ${odl.karaf.empty.distro.version} - zip - - - - - - org.opendaylight.odlparent - features-test - ${odl.commons.opendaylight.version} - test - - - - org.opendaylight.yangtools - features-yangtools - ${odl.yangtools.version} - features - xml - runtime - - + 0.2.1-SNAPSHOT + pom - - - - true - src/main/resources - - - - - org.apache.maven.plugins - maven-resources-plugin - - - filter - - resources - - generate-resources - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/${features.file} - xml - features - - - - - - - - + + ccsdk-properties-node + features-properties-node + diff --git a/properties-node/features/src/main/resources/features.xml b/properties-node/features/src/main/resources/features.xml deleted file mode 100644 index 9abacf0b8..000000000 --- a/properties-node/features/src/main/resources/features.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features - - - sdnc-sli - spring - spring-dm - mvn:org.onap.ccsdk.sli.plugins/properties-node-provider/${project.version} - - - - diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 8a3330a8f..359c8fb83 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -1,20 +1,24 @@ - + 4.0.0 + - properties-node - org.onap.ccsdk.sli.plugins - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + org.onap.ccsdk.sli.plugins properties-node-installer - Properties node - Karaf Installer + 0.2.1-SNAPSHOT pom + ccsdk-sli-plugins :: properties-node :: ${project.artifactId} + - sdnc-properties-node - sdnc-properties-node - mvn:org.onap.ccsdk.sli.plugins/properties-node-features/${project.version}/xml/features + ccsdk-properties-node + ${application.name} + mvn:org.onap.ccsdk.sli.plugins/${features.boot}/${project.version}/xml/features false @@ -22,10 +26,10 @@ org.onap.ccsdk.sli.plugins - properties-node-features + ${application.name} ${project.version} - features xml + features * @@ -99,8 +103,7 @@ true false false - org.onap.ccsdk.sli - sli-common,sli-provider,dblib-provider + org.onap.ccsdk.sli.plugins provided @@ -135,5 +138,4 @@ - diff --git a/properties-node/installer/src/main/resources/scripts/install-feature.sh b/properties-node/installer/src/main/resources/scripts/install-feature.sh index df03392c8..0eab001d5 100644 --- a/properties-node/installer/src/main/resources/scripts/install-feature.sh +++ b/properties-node/installer/src/main/resources/scripts/install-feature.sh @@ -10,9 +10,9 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,7 +23,6 @@ ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} -ODL_KARAF_CLIENT_OPTS=${ODL_KARAF_CLIENT_OPTS:-"-u karaf"} INSTALLERDIR=$(dirname $0) REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip @@ -36,5 +35,5 @@ else exit 1 fi -${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:repo-add ${features.repositories} -${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:install ${features.boot} +${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} feature:install ${features.boot} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index ea03a6423..8e99cf6cf 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -1,43 +1,25 @@ - + + 4.0.0 + - org.onap.ccsdk.sli.plugins - ccsdk-sli-plugins - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT - 4.0.0 - pom - org.onap.ccsdk.sli.plugins properties-node - 0.2.0-SNAPSHOT + 0.2.1-SNAPSHOT + pom - Properties Node + ccsdk-sli-plugins :: properties-node This is an implementation of DG Execute Node that reads property file and puts the properties in the DG context - - - - org.onap.ccsdk.sli.plugins - properties-node-features - features - xml - ${project.version} - - - org.onap.ccsdk.sli.plugins - properties-node-provider - ${project.version} - - - - provider features installer - diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index d622e59e9..c354dc1fc 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -1,89 +1,43 @@ 4.0.0 + - org.onap.ccsdk.sli.plugins - properties-node - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + org.onap.ccsdk.sli.plugins - 0.2.0-SNAPSHOT properties-node-provider + 0.2.1-SNAPSHOT bundle - Properties Node - Provider + + ccsdk-sli-plugins :: properties-node :: ${project.artifactId} http://maven.apache.org + UTF-8 + junit junit test - - org.springframework - spring-test - ${spring.version} - test - org.onap.ccsdk.sli.core sli-common - ${sdnctl.sli.version} - compile org.onap.ccsdk.sli.core sli-provider - ${sdnctl.sli.version} - compile org.slf4j slf4j-api - ${slf4j.version} - - - org.slf4j - jcl-over-slf4j - ${slf4j.version} - - - org.springframework - spring-beans - ${spring.version} - - org.springframework - spring-context - ${spring.version} - - - - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - org.onap.ccsdk.sli.prop - org.onap.ccsdk.sli.prop - * - - - - - - - - - - + diff --git a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml deleted file mode 100644 index 52d1cd96a..000000000 --- a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-context.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - diff --git a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml b/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml deleted file mode 100644 index a46e37c7b..000000000 --- a/properties-node/provider/src/main/resources/META-INF/spring/properties-node-osgi-context.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - diff --git a/properties-node/provider/src/main/resources/org/opendaylight/blueprint/properties-node-blueprint.xml b/properties-node/provider/src/main/resources/org/opendaylight/blueprint/properties-node-blueprint.xml new file mode 100755 index 000000000..6e1d48efd --- /dev/null +++ b/properties-node/provider/src/main/resources/org/opendaylight/blueprint/properties-node-blueprint.xml @@ -0,0 +1,16 @@ + + + + + + + + + + org.onap.ccsdk.sli.plugins.prop.PropertiesNode + + + + \ No newline at end of file diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml new file mode 100644 index 000000000..aa54b4cf7 --- /dev/null +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.plugins + ccsdk-restapi-call-node + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + + + + true + + + + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + restapi-call-node-provider + ${project.version} + + + com.sun.jersey + jersey-client + + + org.codehaus.jettison + jettison + + + diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml new file mode 100644 index 000000000..3347502b9 --- /dev/null +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.plugins + features-restapi-call-node + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + + + + ${project.groupId} + ccsdk-restapi-call-node + ${project.version} + xml + features + + + + diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 41af12507..98494089c 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -1,135 +1,22 @@ - 4.0.0 - - restapi-call-node - org.onap.ccsdk.sli.plugins - 0.2.0-SNAPSHOT - - org.onap.ccsdk.sli.plugins - 0.2.0-SNAPSHOT - restapi-call-node-features - RESTAPI Call Node - Features + 4.0.0 - jar + + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + - + org.onap.ccsdk.sli.plugins + restapi-call-node-features + 0.2.1-SNAPSHOT + pom - - org.onap.ccsdk.sli.plugins - restapi-call-node-provider - ${project.version} - + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - - commons-lang - commons-lang - 2.6 - compile - - - - org.opendaylight.mdsal - features-mdsal - ${odl.mdsal.features.version} - features - xml - - runtime - - - - - - org.opendaylight.controller - opendaylight-karaf-empty - ${odl.karaf.empty.distro.version} - zip - - - - - - org.opendaylight.odlparent - features-test - ${odl.commons.opendaylight.version} - test - - - - org.opendaylight.yangtools - features-yangtools - ${odl.yangtools.version} - features - xml - runtime - - - - - - - true - src/main/resources - - - - - org.apache.maven.plugins - maven-resources-plugin - - - filter - - resources - - generate-resources - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/${features.file} - xml - features - - - - - - - - + + ccsdk-restapi-call-node + features-restapi-call-node + diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index aedb3b705..68fe477d9 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -1,20 +1,24 @@ - + 4.0.0 + - restapi-call-node - org.onap.ccsdk.sli.plugins - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + org.onap.ccsdk.sli.plugins restapi-call-node-installer - Properties node - Karaf Installer + 0.2.1-SNAPSHOT pom + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + - sdnc-restapi-call-node - sdnc-restapi-call-node - mvn:org.onap.ccsdk.sli.plugins/restapi-call-node-features/${project.version}/xml/features + ccsdk-restapi-call-node + ${application.name} + mvn:org.onap.ccsdk.sli.plugins/${features.boot}/${project.version}/xml/features false @@ -22,10 +26,10 @@ org.onap.ccsdk.sli.plugins - restapi-call-node-features + ${application.name} ${project.version} - features xml + features * @@ -39,7 +43,14 @@ restapi-call-node-provider ${project.version} - + + org.springframework + spring-beans + + + org.springframework + spring-context + @@ -99,8 +110,7 @@ true false false - org.onap.ccsdk.sli - sli-common,sli-provider,dblib-provider + org.onap.ccsdk.sli.core provided @@ -135,5 +145,4 @@ - diff --git a/restapi-call-node/installer/src/main/resources/scripts/install-feature.sh b/restapi-call-node/installer/src/main/resources/scripts/install-feature.sh index e986764b9..cee4a4952 100644 --- a/restapi-call-node/installer/src/main/resources/scripts/install-feature.sh +++ b/restapi-call-node/installer/src/main/resources/scripts/install-feature.sh @@ -10,9 +10,9 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,7 +23,6 @@ ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} -ODL_KARAF_CLIENT_OPTS=${ODL_KARAF_CLIENT_OPTS:-"-u karaf"} INSTALLERDIR=$(dirname $0) REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip @@ -36,5 +35,5 @@ else exit 1 fi -${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:repo-add ${features.repositories} -${ODL_KARAF_CLIENT} ${ODL_KARAF_CLIENT_OPTS} feature:install ${features.boot} +${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} feature:install ${features.boot} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index d48253e08..e55fd29a9 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -1,42 +1,24 @@ - + + 4.0.0 + - org.onap.ccsdk.sli.plugins - ccsdk-sli-plugins - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT - 4.0.0 - pom - org.onap.ccsdk.sli.plugins restapi-call-node - 0.2.0-SNAPSHOT + 0.2.1-SNAPSHOT + pom - RESTAPI Call Node + ccsdk-sli-plugins :: restapi-call-node This is an implementation of DG Execute Node that makes a call to an external REST API - - - - org.onap.ccsdk.sli.plugins - restapi-call-node-features - features - xml - ${project.version} - - - org.onap.ccsdk.sli.plugins - restapi-call-node-provider - ${project.version} - - - - provider features installer - diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 0d6b3fb86..aae29ead0 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -1,20 +1,25 @@ 4.0.0 + - org.onap.ccsdk.sli.plugins - restapi-call-node - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.2.0-SNAPSHOT + 0.2.1-SNAPSHOT bundle - RESTAPI Call Node - Provider + + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} http://maven.apache.org + UTF-8 + junit @@ -24,78 +29,37 @@ org.springframework spring-test - ${spring.version} test org.onap.ccsdk.sli.core sli-common - ${sdnctl.sli.version} - compile org.onap.ccsdk.sli.core sli-provider - ${sdnctl.sli.version} - compile org.slf4j slf4j-api - ${slf4j.version} - - - org.slf4j - jcl-over-slf4j - ${slf4j.version} org.springframework spring-beans - ${spring.version} org.springframework spring-context - ${spring.version} com.sun.jersey jersey-client - ${jersey.version} provided org.codehaus.jettison jettison - ${jettison.version} provided - - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - org.onap.ccsdk.sli.restapicall - org.onap.ccsdk.sli.plugins.restapicall - * - - - - - - - - - - - -- cgit 1.2.3-korg From 3fc57645ddea0895cbd0a902c81549f0606161f7 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Wed, 7 Mar 2018 20:02:33 +0000 Subject: restore previous template behavior previously this exception was not thrown, it was caught and ignored. This restores backwards compatibility Change-Id: Ia07c409f47be1269f959134ddbd4aa2898004e7d Issue-ID: CCSDK-203 Signed-off-by: Smokowski, Kevin (ks6305) --- .../java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 3 +-- .../org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index c4ad4c55b..572b2042f 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -382,8 +382,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { try { n = Integer.parseInt(value1); } catch (NumberFormatException e) { - throw new SvcLogicException("Invalid input of repeat interval, should be an integer value " + - e.getLocalizedMessage(), e); + log.info("value1 not set or not a number, n will remain set at zero"); } newTemplate.append(template.substring(k, i1)); diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 2da5b2c83..09fa8355a 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -91,7 +91,7 @@ public class TestRestapiCallNode { rcn.sendRequest(p, ctx); } - @Test(expected = SvcLogicException.class) + @Test public void testInvalidRepeatTimes() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); ctx.setAttribute("tmp.sdn-circuit-req-row_length", "a"); -- cgit 1.2.3-korg From 5146216d32145407e91dee490e5d1f4ccb56e0bb Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Tue, 13 Mar 2018 19:13:19 +0000 Subject: add request body param allow request body to be passed into rest api call node Change-Id: I14a79fccb8dc3e29f2ec487bb6ba2f8021a0e498 Issue-ID: CCSDK-210 Signed-off-by: Smokowski, Kevin (ks6305) --- .../main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java | 1 + .../java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 3 +++ 2 files changed, 4 insertions(+) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java index 1eed09e90..47bb655f5 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java @@ -43,4 +43,5 @@ public class Parameters { public String customHttpHeaders; public String partner; public Boolean dumpHeaders; + public String requestBody; } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 572b2042f..e5c185968 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -131,6 +131,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (p.templateFileName != null) { String reqTemplate = readFile(p.templateFileName); req = buildXmlJsonRequest(ctx, reqTemplate, p.format); + } else if (p.requestBody != null) { + req = p.requestBody; } r = sendHttpRequest(req, p); setResponseStatus(ctx, p.responsePrefix, r); @@ -209,6 +211,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { protected Parameters getParameters(Map paramMap) throws SvcLogicException { Parameters p = new Parameters(); p.templateFileName = parseParam(paramMap, "templateFileName", false, null); + p.requestBody = parseParam(paramMap, "requestBody", false, null); p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); validateUrl(p.restapiUrl); p.restapiUser = parseParam(paramMap, "restapiUser", false, null); -- cgit 1.2.3-korg From 09031e372568052390f514ad37efa919299153a4 Mon Sep 17 00:00:00 2001 From: Ganesh Chandrasekaran Date: Mon, 2 Apr 2018 17:29:53 +0900 Subject: RESTapiCallNode make request without content-type currently the RESTAPI adaptor doesn't make a REST request with empty Content-type, this change is to help the adaptor to make request with no Content-type, currently defaulting to application/json. This is to avoid, when some servers throw 415 Unsupported Media Type error, when they dont support JSON response. Issue-ID: CCSDK-232 Change-Id: I19fbb949f0aad4ea7ca91d6afcac06a5b7f8deed Signed-off-by: Ganesh Chandrasekaran --- .../src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java | 4 +++- .../java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java index 776485afa..1578ee320 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java @@ -22,13 +22,15 @@ package org.onap.ccsdk.sli.plugins.restapicall; public enum Format { - JSON, XML; + JSON, XML, NONE; public static Format fromString(String s) { if ("json".equalsIgnoreCase(s)) return JSON; if ("xml".equalsIgnoreCase(s)) return XML; + if ("none".equalsIgnoreCase(s)) + return NONE; throw new IllegalArgumentException("Invalid value for format: " + s); } } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index e5c185968..ea2d259b7 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -437,7 +437,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { Client client = Client.create(config); client.setConnectTimeout(5000); - if (p.restapiUser != null) + if (p.restapiUser != null && p.restapiPassword != null) client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); WebResource webResource = client.resource(p.restapiUrl); @@ -457,6 +457,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } WebResource.Builder webResourceBuilder = webResource.accept(tt).type(tt1); + if(p.format == Format.NONE){ + webResourceBuilder = webResource.header("",""); + } if (p.customHttpHeaders != null && p.customHttpHeaders.length() > 0) { String[] keyValuePairs = p.customHttpHeaders.split(","); -- cgit 1.2.3-korg From da48f72cb03bf7b5eca0be26d1d0302bb6dc8147 Mon Sep 17 00:00:00 2001 From: Ganesh Chandrasekaran Date: Tue, 3 Apr 2018 08:23:45 +0900 Subject: JUnit tests added Issue-ID: CCSDK-232 Change-Id: I4ee2201510b6ad43ec74d27cbc781da75f182cef Signed-off-by: Ganesh Chandrasekaran --- .../plugins/restapicall/TestRestapiCallNode.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 09fa8355a..4809ca7c0 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -380,4 +380,41 @@ public class TestRestapiCallNode { RestapiCallNode rcn = new RestapiCallNode(); rcn.sendRequest(p, ctx); } + + + @Test + public void testDeleteNoneAsContentType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testPostNoneAsContentType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "none"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } } -- cgit 1.2.3-korg From 5809abef574106cda283c4a33999adee43a59542 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Sun, 29 Apr 2018 19:23:36 -0400 Subject: Roll versions step 5 : sli/plugins poms Roll versions for next release candidate. Change-Id: I0492be8c774aa23f1e0ff2bb1944eae2e818e183 Issue-ID: CCSDK-257 Signed-off-by: Timoney, Dan (dt5972) --- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 4 ++-- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- version.properties | 2 +- 14 files changed, 27 insertions(+), 27 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index 0a01af400..0de6405d0 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 992e1099b..fd897b7d3 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index b39826221..bd91a282d 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 0d4476585..81ce31823 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 359c8fb83..e12ab4687 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 8e99cf6cf..0e1556a5a 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index c354dc1fc..5e042c960 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index aa54b4cf7..7bcc67ad0 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 3347502b9..a5f12dcbc 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 98494089c..c51af4228 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 68fe477d9..2ebcabea1 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index e55fd29a9..ba6f7d776 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index aae29ead0..fcece6900 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.2.1-SNAPSHOT + 0.2.2-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/version.properties b/version.properties index 92e459540..7862a834a 100644 --- a/version.properties +++ b/version.properties @@ -7,7 +7,7 @@ release_name=0 sprint_number=2 -feature_revision=1 +feature_revision=2 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From ad31eaad93ac40d814996928873a4d1830c12fce Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 15 May 2018 15:40:54 -0400 Subject: Add blueprint for restapicallnode Restapicallnode was using spring-dm to advertise itself in Amsterdam. This no longer is supported in Karaf 4 (Nitrogen) so need to use Aries Blueprint. Change-Id: Id78811a5c8c443bcdc8c906e33e57660560ef586 Issue-ID: CCSDK-277 Signed-off-by: Timoney, Dan (dt5972) --- .../blueprint/restapi-call-node-blueprint.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 restapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/restapi-call-node-blueprint.xml (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/restapi-call-node-blueprint.xml b/restapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/restapi-call-node-blueprint.xml new file mode 100755 index 000000000..390bb0a35 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/restapi-call-node-blueprint.xml @@ -0,0 +1,16 @@ + + + + + + + + + + org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode + + + + \ No newline at end of file -- cgit 1.2.3-korg From 25db2c02240103cc1eb9c11355db97d8c3a37a42 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 17 May 2018 19:06:07 -0400 Subject: Update sli/plugins to use 1.0.2 parent Update pom.xmls to use released 1.0.2 version of parent Change-Id: I7ce1568347e217e5f9d1978dc620f3a0b52a60a0 Issue-ID: CCSDK-286 Signed-off-by: Timoney, Dan (dt5972) --- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 2 +- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 2 +- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index 0de6405d0..48fdb5fcf 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index fd897b7d3..e0124b633 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index bd91a282d..92989c968 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 81ce31823..d9c99fe13 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.plugins diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index e12ab4687..74e58e44b 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 0e1556a5a..527819a32 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.plugins diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 5e042c960..e6b2d61b0 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 7bcc67ad0..99761aa81 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index a5f12dcbc..d04af2707 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.2-SNAPSHOT + 1.0.2 diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index c51af4228..a57a01276 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 2ebcabea1..55f462de7 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index ba6f7d776..c19ead71f 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index fcece6900..135ea6142 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.2-SNAPSHOT + 1.0.2 org.onap.ccsdk.sli.plugins -- cgit 1.2.3-korg From 189be235f9ad5ebd92bd93ea49152b4333e879e1 Mon Sep 17 00:00:00 2001 From: "Stilwell, David (stilwelld)" Date: Wed, 23 May 2018 12:47:15 -0400 Subject: Roll to next snapshot version Roll to version 0.2.3-SNAPSHOT and update parent to 1.0.3-SNAPSHOT Change-Id: Idc86fcb6e7cd6c691db61a774a6582f574489a90 Issue-ID: CCSDK-290 Signed-off-by: Stilwell, David (stilwelld) --- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 4 ++-- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- version.properties | 2 +- 14 files changed, 27 insertions(+), 27 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index 48fdb5fcf..d4ee67455 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index e0124b633..1bd3a8b98 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 92989c968..f38ad181b 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index d9c99fe13..cf4c440c7 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 74e58e44b..b9ed78ed5 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 527819a32..c4814abd8 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index e6b2d61b0..6574cb102 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 99761aa81..4c2635848 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index d04af2707..30a22da09 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index a57a01276..fedafd235 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 55f462de7..1f6fd27be 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index c19ead71f..8ecd53335 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 135ea6142..918403922 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.0.2 + 1.0.3-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/version.properties b/version.properties index 7862a834a..66decce4b 100644 --- a/version.properties +++ b/version.properties @@ -7,7 +7,7 @@ release_name=0 sprint_number=2 -feature_revision=2 +feature_revision=3 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 4f5ae57e8b948d680b4c169ad2795025960649d4 Mon Sep 17 00:00:00 2001 From: "Stilwell, David (stilwelld)" Date: Wed, 23 May 2018 17:16:50 -0400 Subject: Update to release version parent 1.0.3 Update parent version to remove -SNAPSHOT (1.0.3) Change-Id: I7e790d752edfaad02780a40d3dd4802e915752a7 Issue-ID: CCSDK-290 Signed-off-by: Stilwell, David (stilwelld) --- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 2 +- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 2 +- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index d4ee67455..0386e16b1 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 1bd3a8b98..e724df18d 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index f38ad181b..f85243a16 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index cf4c440c7..9c2443f70 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.plugins diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index b9ed78ed5..e782c91ac 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index c4814abd8..bb4c8a2db 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.plugins diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 6574cb102..004cc57f1 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 4c2635848..ed6604c2d 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 30a22da09..f3b076249 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.3-SNAPSHOT + 1.0.3 diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index fedafd235..563c38fb5 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 1f6fd27be..dcccc14c2 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 8ecd53335..dd938583f 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 918403922..2411a26bc 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.3-SNAPSHOT + 1.0.3 org.onap.ccsdk.sli.plugins -- cgit 1.2.3-korg From 054268fcc23260ba89bea7fdb07f6037a6fd76bc Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 30 May 2018 18:12:49 -0400 Subject: Roll version to 0.2.4 Roll version to 0.2.4-SNAPSHOT and version 1.0.4-SNAPSHOT of parent Change-Id: I3e657bba0043cc713c7ed20883fb975a058be3aa Issue-ID: CCSDK-291 Signed-off-by: Timoney, Dan (dt5972) --- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 4 ++-- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- version.properties | 2 +- 14 files changed, 27 insertions(+), 27 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index 0386e16b1..99b484ec0 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index e724df18d..f3b39257d 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index f85243a16..1b3f5a8b7 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 9c2443f70..f0a45571f 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index e782c91ac..179ca1c2c 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index bb4c8a2db..57d8ecfcb 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 004cc57f1..2d648035d 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index ed6604c2d..a789d96b9 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index f3b076249..8dd62d094 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 563c38fb5..be1ef23a1 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index dcccc14c2..64151c6ad 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index dd938583f..d34163380 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 2411a26bc..35d55cc40 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.0.3 + 1.0.4-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.2.3-SNAPSHOT + 0.2.4-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/version.properties b/version.properties index 66decce4b..eef7ce9c0 100644 --- a/version.properties +++ b/version.properties @@ -7,7 +7,7 @@ release_name=0 sprint_number=2 -feature_revision=3 +feature_revision=4 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From ea26c5d881e669021c6dfc31202c9c4ff544d5dd Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 31 May 2018 14:27:07 -0400 Subject: Use released parent pom Update to use release parent pom version 1.0.4 Change-Id: I3bbcdbeb1e8d0e6b02791e9c935c6819dbc2948b Issue-ID: CCSDK-291 Signed-off-by: Timoney, Dan (dt5972) --- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 2 +- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 2 +- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index 99b484ec0..d33d5debd 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index f3b39257d..8d61c4ee1 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 1b3f5a8b7..3861350fe 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index f0a45571f..99f0a9278 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.plugins diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 179ca1c2c..90fffb208 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 57d8ecfcb..833d0b102 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.plugins diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 2d648035d..ca7e8d6f7 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index a789d96b9..d2d571b9d 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 8dd62d094..60e0cc7bf 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.4-SNAPSHOT + 1.0.4 diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index be1ef23a1..0b317861f 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 64151c6ad..7c10a412e 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index d34163380..9ed310f73 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 35d55cc40..85340ddcb 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.0.4-SNAPSHOT + 1.0.4 org.onap.ccsdk.sli.plugins -- cgit 1.2.3-korg From 2642a03e5aee31ce5d51719adce283f7cd96c7b9 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 6 Jun 2018 14:11:23 -0400 Subject: Roll versions for Casablanca - sli/plugins Roll to version 0.3.0-SNAPSHOT for Casablanca development Change-Id: Id71eaf1ac29d2b383e6c99710700b332974c31ef Issue-ID: CCSDK-295 Signed-off-by: Timoney, Dan (dt5972) --- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 4 ++-- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- version.properties | 6 +++--- 14 files changed, 29 insertions(+), 29 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index d33d5debd..8c1301332 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 8d61c4ee1..420ba49d9 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 3861350fe..e8f168e2b 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 99f0a9278..dd0e824f0 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 90fffb208..c9a11c613 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 833d0b102..eb7dcbb51 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index ca7e8d6f7..9dcdb9b62 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index d2d571b9d..43dcc74f0 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 60e0cc7bf..dfcef32f4 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 0b317861f..14e9ae022 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 7c10a412e..0badf58b5 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 9ed310f73..641bcc863 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 85340ddcb..45fbdff18 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.0.4 + 1.1.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.2.4-SNAPSHOT + 0.3.0-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/version.properties b/version.properties index eef7ce9c0..53760c8c7 100644 --- a/version.properties +++ b/version.properties @@ -6,11 +6,11 @@ # Comment release_name=0 -sprint_number=2 -feature_revision=4 +sprint_number=3 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version} +release_version=${base_version}-STAGING snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From 600aab4f869d5b632f055dce5cb910ce1d5a348e Mon Sep 17 00:00:00 2001 From: Ganesh Chandrasekaran Date: Tue, 12 Jun 2018 18:39:44 +0900 Subject: support oAuth authentication method Issue-ID: CCSDK-298 Change-Id: I16d3e15f0250c78b48886c80d9a4427838ae36b3 Signed-off-by: Ganesh Chandrasekaran --- .../features/src/main/resources/features.xml | 2 ++ restapi-call-node/provider/pom.xml | 12 ++++++++++++ .../ccsdk/sli/plugins/restapicall/Parameters.java | 4 ++++ .../sli/plugins/restapicall/RestapiCallNode.java | 22 ++++++++++++++++++++++ .../plugins/restapicall/TestRestapiCallNode.java | 18 ++++++++++++++++++ .../provider/src/test/resources/test.xml | 10 ++++++++++ 6 files changed, 68 insertions(+) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/features/src/main/resources/features.xml b/restapi-call-node/features/src/main/resources/features.xml index da9266f9e..a764aa477 100644 --- a/restapi-call-node/features/src/main/resources/features.xml +++ b/restapi-call-node/features/src/main/resources/features.xml @@ -33,6 +33,8 @@ spring spring-dm mvn:com.sun.jersey/jersey-client/${jersey.version} + mvn:com.sun.jersey.contribs.jersey-oauth/oauth-signature/${jersey.version} + mvn:com.sun.jersey.contribs.jersey-oauth/oauth-client/${jersey.version} mvn:org.codehaus.jettison/jettison/${jettison.version} mvn:org.onap.ccsdk.sli.plugins/restapi-call-node-provider/${project.version} diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 45fbdff18..4831356c3 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -56,6 +56,18 @@ jersey-client provided + + com.sun.jersey.contribs.jersey-oauth + oauth-signature + ${jersey.version} + provided + + + com.sun.jersey.contribs.jersey-oauth + oauth-client + ${jersey.version} + provided + org.codehaus.jettison jettison diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java index 47bb655f5..3a4bc76c5 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java @@ -44,4 +44,8 @@ public class Parameters { public String partner; public Boolean dumpHeaders; public String requestBody; + public String oAuthConsumerKey; + public String oAuthConsumerSecret; + public String oAuthSignatureMethod; + public String oAuthVersion; } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index ea2d259b7..bd2fc8267 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -62,6 +62,9 @@ import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.config.ClientConfig; import com.sun.jersey.api.client.config.DefaultClientConfig; import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; +import com.sun.jersey.oauth.client.OAuthClientFilter; +import com.sun.jersey.oauth.signature.OAuthParameters; +import com.sun.jersey.oauth.signature.OAuthSecrets; import com.sun.jersey.client.urlconnection.HTTPSProperties; public class RestapiCallNode implements SvcLogicJavaPlugin { @@ -94,6 +97,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { * * * + * + * + * + * * * * @@ -216,6 +223,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { validateUrl(p.restapiUrl); p.restapiUser = parseParam(paramMap, "restapiUser", false, null); p.restapiPassword = parseParam(paramMap, "restapiPassword", false, null); + p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", false, null); + p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", false, null); + p.oAuthSignatureMethod = parseParam(paramMap, "oAuthSignatureMethod", false, null); + p.oAuthVersion = parseParam(paramMap, "oAuthVersion", false, null); p.contentType = parseParam(paramMap, "contentType", false, null); p.format = Format.fromString(parseParam(paramMap, "format", false, "json")); p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); @@ -439,6 +450,17 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { client.setConnectTimeout(5000); if (p.restapiUser != null && p.restapiPassword != null) client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); + else if(p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null && p.oAuthSignatureMethod != null && p.oAuthVersion != null) + { + OAuthParameters params = new OAuthParameters() + .signatureMethod(p.oAuthSignatureMethod) + .consumerKey(p.oAuthConsumerKey) + .version(p.oAuthVersion); + + OAuthSecrets secrets = new OAuthSecrets() + .consumerSecret(p.oAuthConsumerSecret); + client.addFilter(new OAuthClientFilter(client.getProviders(), params, secrets)); + } WebResource webResource = client.resource(p.restapiUrl); log.info("Sending request:"); diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 4809ca7c0..88a1eeaeb 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -417,4 +417,22 @@ public class TestRestapiCallNode { RestapiCallNode rcn = new RestapiCallNode(); rcn.sendRequest(p, ctx); } + + @Test + public void testDeleteOAuthType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } } diff --git a/restapi-call-node/provider/src/test/resources/test.xml b/restapi-call-node/provider/src/test/resources/test.xml index b60b5356e..1974f688e 100644 --- a/restapi-call-node/provider/src/test/resources/test.xml +++ b/restapi-call-node/provider/src/test/resources/test.xml @@ -87,6 +87,16 @@ jersey-client 1.17 + + com.sun.jersey.contribs.jersey-oauth + oauth-signature + 1.17 + + + com.sun.jersey.contribs.jersey-oauth + oauth-client + 1.17 + commons-codec commons-codec -- cgit 1.2.3-korg From a87dc9c351b0c08d20adc428c215cf3934bb79bb Mon Sep 17 00:00:00 2001 From: Ganesh Chandrasekaran Date: Thu, 14 Jun 2018 08:02:31 +0900 Subject: CCSDK plugin has authType param for DG to sel type Issue-ID: CCSDK-299 Change-Id: I61a56c873189ccc6ba9985c5121d50e2ad1f3f48 Signed-off-by: Ganesh Chandrasekaran --- .../ccsdk/sli/plugins/restapicall/AuthType.java | 19 +++ .../ccsdk/sli/plugins/restapicall/Parameters.java | 1 + .../sli/plugins/restapicall/RestapiCallNode.java | 92 +++++++++++--- .../plugins/restapicall/TestRestapiCallNode.java | 137 +++++++++++++++++++++ 4 files changed, 232 insertions(+), 17 deletions(-) create mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/AuthType.java (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/AuthType.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/AuthType.java new file mode 100644 index 000000000..851dc9cc8 --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/AuthType.java @@ -0,0 +1,19 @@ +package org.onap.ccsdk.sli.plugins.restapicall; + +public enum AuthType { + NONE, BASIC, DIGEST, OAUTH, Unspecified; + + public static AuthType fromString(String s) { + if ("basic".equalsIgnoreCase(s)) + return BASIC; + if ("digest".equalsIgnoreCase(s)) + return DIGEST; + if ("oauth".equalsIgnoreCase(s)) + return OAUTH; + if ("none".equalsIgnoreCase(s)) + return NONE; + if ("unspecified".equalsIgnoreCase(s)) + return Unspecified; + throw new IllegalArgumentException("Invalid value for format: " + s); + } +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java index 3a4bc76c5..c170cfc7d 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java @@ -48,4 +48,5 @@ public class Parameters { public String oAuthConsumerSecret; public String oAuthSignatureMethod; public String oAuthVersion; + public AuthType authtype; } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index bd2fc8267..d215d9092 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -62,6 +62,7 @@ import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.config.ClientConfig; import com.sun.jersey.api.client.config.DefaultClientConfig; import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; +import com.sun.jersey.api.client.filter.HTTPDigestAuthFilter; import com.sun.jersey.oauth.client.OAuthClientFilter; import com.sun.jersey.oauth.signature.OAuthParameters; import com.sun.jersey.oauth.signature.OAuthSecrets; @@ -229,6 +230,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.oAuthVersion = parseParam(paramMap, "oAuthVersion", false, null); p.contentType = parseParam(paramMap, "contentType", false, null); p.format = Format.fromString(parseParam(paramMap, "format", false, "json")); + p.authtype = AuthType.fromString(parseParam(paramMap, "authType", false, "unspecified")); p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); p.listNameList = getListNameList(paramMap); @@ -431,6 +433,67 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } } + protected Client addAuthType(Client c, FileParam fp) throws SvcLogicException { + Parameters p = new Parameters(); + p.restapiUser = fp.user; + p.restapiPassword = fp.password; + p.oAuthConsumerKey = fp.oAuthConsumerKey; + p.oAuthVersion = fp.oAuthVersion; + p.oAuthConsumerSecret = fp.oAuthConsumerSecret; + p.oAuthSignatureMethod = fp.oAuthSignatureMethod; + p.authtype = fp.authtype; + return addAuthType(c,p); + } + + protected Client addAuthType(Client client, Parameters p) throws SvcLogicException { + if (p.authtype == AuthType.Unspecified){ + if (p.restapiUser != null && p.restapiPassword != null) + client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); + else if(p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null + && p.oAuthSignatureMethod != null) { + OAuthParameters params = new OAuthParameters() + .signatureMethod(p.oAuthSignatureMethod) + .consumerKey(p.oAuthConsumerKey) + .version(p.oAuthVersion); + + OAuthSecrets secrets = new OAuthSecrets() + .consumerSecret(p.oAuthConsumerSecret); + client.addFilter(new OAuthClientFilter(client.getProviders(), params, secrets)); + } + } else { + if (p.authtype == AuthType.DIGEST) { + if (p.restapiUser != null && p.restapiPassword != null) { + client.addFilter(new HTTPDigestAuthFilter(p.restapiUser, p.restapiPassword)); + } else { + throw new SvcLogicException("oAUTH authentication type selected but all restapiUser and restapiPassword " + + "parameters doesn't exist", new Throwable()); + } + } else if (p.authtype == AuthType.BASIC){ + if (p.restapiUser != null && p.restapiPassword != null) { + client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); + } else { + throw new SvcLogicException("oAUTH authentication type selected but all restapiUser and restapiPassword " + + "parameters doesn't exist", new Throwable()); + } + } else if(p.authtype == AuthType.OAUTH ) { + if(p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null && p.oAuthSignatureMethod != null) { + OAuthParameters params = new OAuthParameters() + .signatureMethod(p.oAuthSignatureMethod) + .consumerKey(p.oAuthConsumerKey) + .version(p.oAuthVersion); + + OAuthSecrets secrets = new OAuthSecrets() + .consumerSecret(p.oAuthConsumerSecret); + client.addFilter(new OAuthClientFilter(client.getProviders(), params, secrets)); + } else { + throw new SvcLogicException("oAUTH authentication type selected but all oAuthConsumerKey, oAuthConsumerSecret " + + "and oAuthSignatureMethod parameters doesn't exist", new Throwable()); + } + } + } + return client; + } + protected HttpResponse sendHttpRequest(String request, Parameters p) throws SvcLogicException { ClientConfig config = new DefaultClientConfig(); @@ -448,20 +511,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { Client client = Client.create(config); client.setConnectTimeout(5000); - if (p.restapiUser != null && p.restapiPassword != null) - client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); - else if(p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null && p.oAuthSignatureMethod != null && p.oAuthVersion != null) - { - OAuthParameters params = new OAuthParameters() - .signatureMethod(p.oAuthSignatureMethod) - .consumerKey(p.oAuthConsumerKey) - .version(p.oAuthVersion); - - OAuthSecrets secrets = new OAuthSecrets() - .consumerSecret(p.oAuthConsumerSecret); - client.addFilter(new OAuthClientFilter(client.getProviders(), params, secrets)); - } - WebResource webResource = client.resource(p.restapiUrl); + WebResource webResource = addAuthType(client,p).resource(p.restapiUrl); log.info("Sending request:"); log.info(request); @@ -592,6 +642,11 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { public HttpMethod httpMethod; public String responsePrefix; public boolean skipSending; + public String oAuthConsumerKey; + public String oAuthConsumerSecret; + public String oAuthSignatureMethod; + public String oAuthVersion; + public AuthType authtype; } private FileParam getFileParameters(Map paramMap) throws SvcLogicException { @@ -604,6 +659,11 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); String skipSendingStr = paramMap.get("skipSending"); p.skipSending = "true".equalsIgnoreCase(skipSendingStr); + p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", false, null); + p.oAuthVersion = parseParam(paramMap, "oAuthVersion", false, null); + p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", false, null); + p.oAuthSignatureMethod = parseParam(paramMap, "oAuthSignatureMethod", false, null); + p.authtype = AuthType.fromString(parseParam(paramMap, "authType", false, "unspecified")); return p; } @@ -611,9 +671,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { Client client = Client.create(); client.setConnectTimeout(5000); client.setFollowRedirects(true); - if (p.user != null) - client.addFilter(new HTTPBasicAuthFilter(p.user, p.password)); - WebResource webResource = client.resource(p.url); + WebResource webResource = addAuthType(client,p).resource(p.url); log.info("Sending file"); long t1 = System.currentTimeMillis(); diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 88a1eeaeb..81806f6de 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -435,4 +435,141 @@ public class TestRestapiCallNode { RestapiCallNode rcn = new RestapiCallNode(); rcn.sendRequest(p, ctx); } + + @Test + public void testDeleteAuthTypeBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "basic"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeDigest() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "digest"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "oauth"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeNoneOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + @Test + public void testDeleteAuthTypeNoneBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "oauth"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "basic"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeDigest() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "digest"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } } -- cgit 1.2.3-korg From 09705266013bdc54b58a8b9791de897aafdf4b8c Mon Sep 17 00:00:00 2001 From: sb5356 Date: Fri, 15 Jun 2018 16:20:12 -0400 Subject: Capability to avoid surrounding values with quotes Restapi-call-node: Give opportunity for developer to specify a variable in a JSON template, so that restapi-call-node will know it should not surround the value with quotes. Change-Id: I844a8fd68f3015cbd6f5b039b8911e903de557ea Issue-ID: CCSDK-296 Signed-off-by: Stan Bonev --- .../ccsdk/sli/plugins/restapicall/XmlJsonUtil.java | 24 +++++++++++++++------- .../sli/plugins/restapicall/TestXmlJsonUtil.java | 6 ++++++ 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java index 965d3daaa..8a0ca8d94 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -55,8 +55,14 @@ public final class XmlJsonUtil { escape = false; } + boolean quotes = true; + if (var.startsWith("\"")) { + var = var.substring(1); + quotes = false; + } + Object o = createStructure(varmap, var); - return generateJson(o, escape); + return generateJson(o, escape, quotes); } private static Object createStructure(Map flatmap, String var) { @@ -159,22 +165,26 @@ public final class XmlJsonUtil { return null; } - private static String generateJson(Object o, boolean escape) { + private static String generateJson(Object o, boolean escape, boolean quotes) { if (o == null) return null; StringBuilder ss = new StringBuilder(); - generateJson(ss, o, 0, false, escape); + generateJson(ss, o, 0, false, escape, quotes); return ss.toString(); } @SuppressWarnings("unchecked") - private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape) { + private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape, boolean quotes) { if (o instanceof String) { String s = escape ? escapeJson((String) o) : (String) o; if (padFirst) ss.append(pad(indent)); - ss.append('"').append(s).append('"'); + if (quotes) { + ss.append('"').append(s).append('"'); + } else { + ss.append(s); + } return; } @@ -193,7 +203,7 @@ public final class XmlJsonUtil { Object v = entry.getValue(); String key = entry.getKey(); ss.append(pad(indent + 1)).append('"').append(key).append("\": "); - generateJson(ss, v, indent + 1, false, escape); + generateJson(ss, v, indent + 1, false, escape, true); } ss.append("\n"); @@ -215,7 +225,7 @@ public final class XmlJsonUtil { ss.append(",\n"); first = false; - generateJson(ss, o1, indent + 1, true, escape); + generateJson(ss, o1, indent + 1, true, escape, quotes); } ss.append("\n"); diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java index 579d194d5..fcbd844fc 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java @@ -144,6 +144,12 @@ public class TestXmlJsonUtil { ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); } @Test -- cgit 1.2.3-korg From 7ef4659e0b07164402cf6d7aa89b45df03063669 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Mon, 18 Jun 2018 11:54:35 -0400 Subject: Update sli/plugins to ODL Oxygen Minor updates to feature pom.xmls to get clean compile with ODL Oxygen parent poms. Change-Id: I8671ad1366b8dc2e79fe206971675ba56a0e2bac Issue-ID: CCSDK-283 Signed-off-by: Timoney, Dan (dt5972) --- .../features/ccsdk-properties-node/pom.xml | 29 ++++--- .../features/ccsdk-restapi-call-node/pom.xml | 92 +++++++++++----------- restapi-call-node/provider/pom.xml | 4 - 3 files changed, 67 insertions(+), 58 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 420ba49d9..fd38cb224 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -16,17 +16,28 @@ ccsdk-sli-plugins :: properties-node :: ${project.artifactId} - - true - + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + ${odl.mdsal.model.version} + pom + import + + + org.opendaylight.controller + mdsal-artifacts + ${odl.mdsal.version} + pom + import + + + + - - org.opendaylight.controller - odl-mdsal-broker - xml - features - + org.onap.ccsdk.sli.core ccsdk-sli diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 43dcc74f0..822a6d1e7 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -1,53 +1,55 @@ - - 4.0.0 + + 4.0.0 - - org.onap.ccsdk.parent - single-feature-parent - 1.1.0-SNAPSHOT - - + + org.onap.ccsdk.parent + single-feature-parent + 1.1.0-SNAPSHOT + + - org.onap.ccsdk.sli.plugins - ccsdk-restapi-call-node - 0.3.0-SNAPSHOT - feature + org.onap.ccsdk.sli.plugins + ccsdk-restapi-call-node + 0.3.0-SNAPSHOT + feature - ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + ${odl.mdsal.model.version} + pom + import + + + org.opendaylight.controller + mdsal-artifacts + ${odl.mdsal.version} + pom + import + + + - - true - + - - - - org.opendaylight.controller - odl-mdsal-broker - xml - features - - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - - - ${project.groupId} - restapi-call-node-provider - ${project.version} - - - com.sun.jersey - jersey-client - - - org.codehaus.jettison - jettison - - + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + restapi-call-node-provider + ${project.version} + + diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 4831356c3..18a20cef1 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -54,24 +54,20 @@ com.sun.jersey jersey-client - provided com.sun.jersey.contribs.jersey-oauth oauth-signature ${jersey.version} - provided com.sun.jersey.contribs.jersey-oauth oauth-client ${jersey.version} - provided org.codehaus.jettison jettison - provided -- cgit 1.2.3-korg From 6603a6b208f454e87215047a3116ca6d40cc56c2 Mon Sep 17 00:00:00 2001 From: as005h Date: Tue, 8 May 2018 14:01:50 -0400 Subject: Share http payload of restapi-call-node Changes to save request payload to context variable based on returnRequestPayload flag Change-Id: I75069f700f34848904204049d6160251ea43578d Issue-ID: CCSDK-365 Signed-off-by: Timoney, Dan (dt5972) --- properties-node/provider/pom.xml | 1 - .../java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java | 1 + .../org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 6 ++++++ 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'restapi-call-node/provider') diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index b3a1cf533..a9a3c94d5 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -46,7 +46,6 @@ org.codehaus.jettison jettison - provided diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java index c170cfc7d..d3fec37ee 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java @@ -49,4 +49,5 @@ public class Parameters { public String oAuthSignatureMethod; public String oAuthVersion; public AuthType authtype; + public Boolean returnRequestPayload; } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index d215d9092..5168b3ec1 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -112,6 +112,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { * * * + * * *
restapiUrlMandatoryurl to send the request tohttps://sdncodl:8543/restconf/operations/L3VNF-API:create-update-vnf-request
restapiUserOptionaluser name to use for http basic authenticationsdnc_ws
restapiPasswordOptionalunencrypted password to use for http basic authenticationplain_password
oAuthConsumerKeyOptionalConsumer key to use for http oAuth authenticationplain_key
oAuthConsumerSecretOptionalConsumer secret to use for http oAuth authenticationplain_secret
oAuthSignatureMethodOptionalConsumer method to use for http oAuth authenticationmethod
oAuthVersionOptionalVersion http oAuth authenticationversion
contentTypeOptionalhttp content type to set in the http headerusually application/json or application/xml
formatOptionalshould match request body formatjson or xml
httpMethodOptionalhttp method to use when sending the requestget post put delete patch
customHttpHeadersOptionala list additional http headers to be passed in, follow the format in the exampleX-CSI-MessageId=messageId,headerFieldName=headerFieldValue
dumpHeadersOptionalwhen true writes http header content to context memorytrue or false
partnerOptionalneeded for DME2 callsdme2proxy
returnRequestPayloadOptionalused to return payload built in the requesttrue or false
* @param ctx Reference to context memory @@ -150,6 +151,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { ctx.setAttribute(pp + "header." + a.getKey(), StringUtils.join(a.getValue(), ",")); } } + + if (p.returnRequestPayload && req != null) { + ctx.setAttribute(pp + "httpRequest", req); + } if (r.body != null && r.body.trim().length() > 0) { ctx.setAttribute(pp + "httpResponse", r.body); @@ -246,6 +251,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null); p.partner = parseParam(paramMap, "partner", false, null); p.dumpHeaders = Boolean.valueOf(parseParam(paramMap, "dumpHeaders", false, null)); + p.returnRequestPayload = Boolean.valueOf(parseParam(paramMap, "returnRequestPayload", false, null)); return p; } -- cgit 1.2.3-korg From d6a56cd8f71cc196083c6ab16e86d24c7c89f9ef Mon Sep 17 00:00:00 2001 From: Ganesh Chandrasekaran Date: Thu, 19 Jul 2018 11:17:06 +0900 Subject: SSHApiCallNode API definition Issue-ID: CCSDK-384 Change-Id: I558bb774081074fbd1c541512d767a9ca5d1f866 Signed-off-by: Ganesh Chandrasekaran --- pom.xml | 1 + .../sli/plugins/restapicall/TestJsonParser.java | 73 --- .../plugins/restapicall/TestRestapiCallNode.java | 575 --------------------- .../sli/plugins/restapicall/TestXmlJsonUtil.java | 262 ---------- .../sli/plugins/restapicall/TestXmlParser.java | 121 ----- .../sli/plugins/sshapicall/TestJsonParser.java | 73 +++ .../plugins/sshapicall/TestRestapiCallNode.java | 575 +++++++++++++++++++++ .../sli/plugins/sshapicall/TestXmlJsonUtil.java | 262 ++++++++++ .../sli/plugins/sshapicall/TestXmlParser.java | 121 +++++ sshapi-call-node/.gitignore | 34 ++ .../features/ccsdk-sshapi-call-node/pom.xml | 55 ++ .../features/features-sshapi-call-node/pom.xml | 31 ++ sshapi-call-node/features/pom.xml | 24 + .../features/src/main/resources/features.xml | 51 ++ sshapi-call-node/installer/pom.xml | 148 ++++++ .../src/assembly/assemble_installer_zip.xml | 59 +++ .../src/assembly/assemble_mvnrepo_zip.xml | 49 ++ .../src/main/resources/scripts/install-feature.sh | 39 ++ sshapi-call-node/pom.xml | 24 + sshapi-call-node/provider/pom.xml | 73 +++ .../sli/plugins/sshapicall/SshApiCallNode.java | 84 +++ .../sli/plugins/sshapicall/impl/AuthType.java | 19 + .../ccsdk/sli/plugins/sshapicall/impl/Format.java | 39 ++ .../sli/plugins/sshapicall/impl/Parameters.java | 42 ++ .../sshapicall/impl/SshapiCallNodeImpl.java | 43 ++ .../sli/plugins/sshapicall/model/JsonParser.java | 96 ++++ .../plugins/sshapicall/model/RetryException.java | 32 ++ .../sli/plugins/sshapicall/model/RetryPolicy.java | 62 +++ .../plugins/sshapicall/model/RetryPolicyStore.java | 56 ++ .../sli/plugins/sshapicall/model/XmlJsonUtil.java | 389 ++++++++++++++ .../sli/plugins/sshapicall/model/XmlParser.java | 174 +++++++ .../META-INF/spring/sshapi-call-node-context.xml | 51 ++ .../spring/sshapi-call-node-osgi-context.xml | 34 ++ .../blueprint/sshapi-call-node-blueprint.xml | 16 + .../sli/plugins/sshapicall/TestJsonParser.java | 75 +++ .../sli/plugins/sshapicall/TestXmlJsonUtil.java | 264 ++++++++++ .../sli/plugins/sshapicall/TestXmlParser.java | 123 +++++ .../provider/src/test/resources/invalidlength.xml | 49 ++ .../provider/src/test/resources/test-template.json | 57 ++ .../provider/src/test/resources/test.json | 51 ++ .../provider/src/test/resources/test.xml | 184 +++++++ .../provider/src/test/resources/test3.xml | 82 +++ 42 files changed, 3641 insertions(+), 1031 deletions(-) delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java create mode 100755 sshapi-call-node/.gitignore create mode 100644 sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml create mode 100644 sshapi-call-node/features/features-sshapi-call-node/pom.xml create mode 100755 sshapi-call-node/features/pom.xml create mode 100644 sshapi-call-node/features/src/main/resources/features.xml create mode 100755 sshapi-call-node/installer/pom.xml create mode 100644 sshapi-call-node/installer/src/assembly/assemble_installer_zip.xml create mode 100644 sshapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml create mode 100644 sshapi-call-node/installer/src/main/resources/scripts/install-feature.sh create mode 100755 sshapi-call-node/pom.xml create mode 100755 sshapi-call-node/provider/pom.xml create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/SshApiCallNode.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/AuthType.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Format.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Parameters.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/SshapiCallNodeImpl.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/JsonParser.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryException.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicy.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicyStore.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/XmlJsonUtil.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/XmlParser.java create mode 100644 sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-context.xml create mode 100644 sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-osgi-context.xml create mode 100755 sshapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/sshapi-call-node-blueprint.xml create mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java create mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java create mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java create mode 100644 sshapi-call-node/provider/src/test/resources/invalidlength.xml create mode 100644 sshapi-call-node/provider/src/test/resources/test-template.json create mode 100644 sshapi-call-node/provider/src/test/resources/test.json create mode 100644 sshapi-call-node/provider/src/test/resources/test.xml create mode 100644 sshapi-call-node/provider/src/test/resources/test3.xml (limited to 'restapi-call-node/provider') diff --git a/pom.xml b/pom.xml index b6efa94ce..ecdce6505 100755 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,7 @@ properties-node restapi-call-node + sshapi-call-node features diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java deleted file mode 100644 index 5526be81f..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java +++ /dev/null @@ -1,73 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.restapicall; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.restapicall.JsonParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestJsonParser { - - private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); - - @Test - public void test() throws SvcLogicException, IOException { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Map mm = JsonParser.convertToProperties(b.toString()); - - logProperties(mm); - - in.close(); - } - - @Test(expected = NullPointerException.class) - public void testNullString() throws SvcLogicException { - JsonParser.convertToProperties(null); - } - - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - log.info("Properties:"); - for (String name : ll) - log.info("--- {}: {}", name, mm.get(name)); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java deleted file mode 100644 index 81806f6de..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ /dev/null @@ -1,575 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.restapicall; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestRestapiCallNode { - - private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); - - - @Test - public void testDelete() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "pwd1"); - p.put("httpMethod", "delete"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testInvalidRepeatTimes() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "a"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidTemplatePath() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resourcess/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testWithoutSkipSending() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "false"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - - @Test(expected = SvcLogicException.class) - public void testWithInvalidURI() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo. getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "false"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testVpnJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testSiteJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - ctx.setAttribute("prop.l3vpn.site1_name", "10000000-0000-0000-0000-000000000002"); - ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); - ctx.setAttribute("prop.l3vpn.entry1-id", "1"); - ctx.setAttribute("prop.l3vpn.sna1_name", "10000000-0000-0000-0000-000000000004"); - ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); - ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b"); - ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1"); - ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2"); - ctx.setAttribute("prop.l3vpn.sna1_svlan", "100"); - ctx.setAttribute("prop.l3vpn.ac1_protocol", "static"); - ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24"); - ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4"); - - ctx.setAttribute("prop.l3vpn.site2_name", "10000000-0000-0000-0000-000000000005"); - ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); - ctx.setAttribute("prop.l3vpn.entry2-id", "1"); - ctx.setAttribute("prop.l3vpn.sna2_name", "10000000-0000-0000-0000-000000000007"); - ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); - ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c"); - ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.6"); - ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5"); - ctx.setAttribute("prop.l3vpn.sna2_svlan", "200"); - ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp"); - ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.7"); - ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l3smsitetemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testVrfJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.vrf1-id", "10000000-0000-0000-0000-000000000007"); - ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); - ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); - ctx.setAttribute("prop.l3vpn.vrf2-id", "10000000-0000-0000-0000-000000000009"); - ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); - ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l3smvrftemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vrf-attributes"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteVpnJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - Map p = new HashMap(); - //p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services" - + "/vpnservice=10000000-0000-0000-0000-000000000001"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "delete"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testL2DciTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.dci-connects.id", "Id1"); - ctx.setAttribute("prop.dci-connects.name", "Name1"); - ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); - ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); - ctx.setAttribute("prop.dci-connects.vni", "1"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l2-dci-connects-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testL3DciTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.dci-connects.id", "Id1"); - ctx.setAttribute("prop.dci-connects.name", "Name1"); - ctx.setAttribute("prop.dci-connects.local_networks_length", "2"); - ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); - ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); - ctx.setAttribute("prop.dci-connects.vni", "1"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l3-dci-connects-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - - } - - @Test - public void testControllerTokenTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.user", "admin"); - ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.password", "admin123"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/actokentemplate.json"); - p.put("restapiUrl", "https://ipwan:18002/controller/v2/tokens"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - - @Test - public void testDeleteNoneAsContentType() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "pwd1"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testPostNoneAsContentType() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "none"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteOAuthType() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "basic"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeDigest() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "digest"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "oauth"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeNoneOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - @Test - public void testDeleteAuthTypeNoneBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "oauth"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "basic"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeDigest() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "digest"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java deleted file mode 100644 index fcbd844fc..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java +++ /dev/null @@ -1,262 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.restapicall; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.Assert; -import org.junit.Test; -import org.onap.ccsdk.sli.plugins.restapicall.XmlJsonUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class TestXmlJsonUtil { - - private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); - - @Test - public void test() { - Map mm = new HashMap<>(); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); - mm.put("service-data.service-information.service-instance-id", "someinstance001"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3_length", "2"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf_length", "1"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", - "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); - - mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); - mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); - mm.put("service-data.vnf-config-information.vendor", "Netconf"); - - mm.put("service-data.vnf-config-information.escape-test", - "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); - - String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); - log.info(ss); - - ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address"); - log.info(ss); - } - - @Test - public void testRemoveEmptyStructXml() { - String xmlin = "" + - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " blah\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " blah blah\n" + - "\n"; - - String xmloutexpected = "" + - "\n" + - " \n" + - " blah\n" + - " \n" + - " blah blah\n" + - "\n"; - - String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); - log.info(xmlout); - - Assert.assertEquals(xmloutexpected, xmlout); - } - - @Test - public void testRemoveEmptyStructJson() { - String xmlin = "{\r\n" + - " \"T1\":{\r\n" + - " \"T2\":{\r\n" + - " \"T3\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T4\":{\r\n" + - " \"T12\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T13\":[ ],\r\n" + - " \"T14\":{\r\n" + - " \"T15\":{\r\n" + - " \r\n" + - " },\r\n" + - " \"T16\":{\r\n" + - " \r\n" + - " }\r\n" + - " }\r\n" + - " },\r\n" + - " \"T5\":{\r\n" + - " \"T6\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T7\":[\r\n" + - " \"T8\":{\r\n" + - " \r\n" + - " },\r\n" + - " \"T9\":{ },\r\n" + - " \"T10\":\"blah\",\r\n" + - " \"T11\":[\r\n" + - " \r\n" + - " ]\r\n" + - " ]\r\n" + - " }\r\n" + - " }\r\n" + - " }\r\n" + - "}\r\n" + - ""; - - String xmloutexpected = "{\r\n" + - " \"T1\":{\r\n" + - " \"T2\":{\r\n" + - " \"T5\":{\r\n" + - " \"T7\":[\r\n" + - " \"T10\":\"blah\",\r\n" + - " ]\r\n" + - " }\r\n" + - " }\r\n" + - " }\r\n" + - "}\r\n" + - ""; - - String xmlout = XmlJsonUtil.removeEmptyStructJson(xmlin); - log.info(xmlout); - - Assert.assertEquals(xmloutexpected, xmlout); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java deleted file mode 100644 index c6bf4a8b9..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java +++ /dev/null @@ -1,121 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.restapicall; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.restapicall.XmlParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestXmlParser { - - private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); - - @Test - public void test() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("project.dependencies.dependency"); - listNameList.add("project.build.plugins.plugin"); - listNameList.add("project.build.plugins.plugin.executions.execution"); - listNameList.add("project.build.pluginManagement.plugins.plugin"); - listNameList.add("project.build.pluginManagement." + - "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - logProperties(mm); - in.close(); - } - - @Test - public void testValidLength() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - - assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport[5]"), is("SET_RESET_LP")); - assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport[0]"), is("SET_BVOIP_IN")); - - logProperties(mm); - in.close(); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidLength() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("invalidlength.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - logProperties(mm); - in.close(); - } - - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - log.info("Properties:"); - for (String name : ll) - log.info("--- " + name + ": " + mm.get(name)); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java new file mode 100644 index 000000000..0216b6675 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.sshapicall; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.JsonParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestJsonParser { + + private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); + + @Test + public void test() throws SvcLogicException, IOException { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Map mm = JsonParser.convertToProperties(b.toString()); + + logProperties(mm); + + in.close(); + } + + @Test(expected = NullPointerException.class) + public void testNullString() throws SvcLogicException { + JsonParser.convertToProperties(null); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + log.info("Properties:"); + for (String name : ll) + log.info("--- {}: {}", name, mm.get(name)); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java new file mode 100644 index 000000000..5c6c4e279 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java @@ -0,0 +1,575 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.sshapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestRestapiCallNode { + + private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); + + + @Test + public void testDelete() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testInvalidRepeatTimes() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "a"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidTemplatePath() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resourcess/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testWithoutSkipSending() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + + @Test(expected = SvcLogicException.class) + public void testWithInvalidURI() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo. getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testVpnJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testSiteJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + ctx.setAttribute("prop.l3vpn.site1_name", "10000000-0000-0000-0000-000000000002"); + ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); + ctx.setAttribute("prop.l3vpn.entry1-id", "1"); + ctx.setAttribute("prop.l3vpn.sna1_name", "10000000-0000-0000-0000-000000000004"); + ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); + ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b"); + ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1"); + ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2"); + ctx.setAttribute("prop.l3vpn.sna1_svlan", "100"); + ctx.setAttribute("prop.l3vpn.ac1_protocol", "static"); + ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24"); + ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4"); + + ctx.setAttribute("prop.l3vpn.site2_name", "10000000-0000-0000-0000-000000000005"); + ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); + ctx.setAttribute("prop.l3vpn.entry2-id", "1"); + ctx.setAttribute("prop.l3vpn.sna2_name", "10000000-0000-0000-0000-000000000007"); + ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); + ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c"); + ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.6"); + ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5"); + ctx.setAttribute("prop.l3vpn.sna2_svlan", "200"); + ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp"); + ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.7"); + ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smsitetemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testVrfJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.vrf1-id", "10000000-0000-0000-0000-000000000007"); + ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); + ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); + ctx.setAttribute("prop.l3vpn.vrf2-id", "10000000-0000-0000-0000-000000000009"); + ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); + ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smvrftemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vrf-attributes"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteVpnJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap(); + //p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services" + + "/vpnservice=10000000-0000-0000-0000-000000000001"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "delete"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testL2DciTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.dci-connects.id", "Id1"); + ctx.setAttribute("prop.dci-connects.name", "Name1"); + ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); + ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); + ctx.setAttribute("prop.dci-connects.vni", "1"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l2-dci-connects-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testL3DciTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.dci-connects.id", "Id1"); + ctx.setAttribute("prop.dci-connects.name", "Name1"); + ctx.setAttribute("prop.dci-connects.local_networks_length", "2"); + ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); + ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); + ctx.setAttribute("prop.dci-connects.vni", "1"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3-dci-connects-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + + } + + @Test + public void testControllerTokenTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.user", "admin"); + ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.password", "admin123"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/actokentemplate.json"); + p.put("restapiUrl", "https://ipwan:18002/controller/v2/tokens"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + + @Test + public void testDeleteNoneAsContentType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testPostNoneAsContentType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "none"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteOAuthType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "basic"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeDigest() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "digest"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "oauth"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeNoneOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + @Test + public void testDeleteAuthTypeNoneBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "oauth"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "basic"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeDigest() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "digest"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java new file mode 100644 index 000000000..bd9ff1c98 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java @@ -0,0 +1,262 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.sshapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; +import org.onap.ccsdk.sli.plugins.restapicall.XmlJsonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class TestXmlJsonUtil { + + private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); + + @Test + public void test() { + Map mm = new HashMap<>(); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); + mm.put("service-data.service-information.service-instance-id", "someinstance001"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3_length", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf_length", "1"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", + "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); + + mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); + mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); + mm.put("service-data.vnf-config-information.vendor", "Netconf"); + + mm.put("service-data.vnf-config-information.escape-test", + "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); + + String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); + log.info(ss); + + ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + } + + @Test + public void testRemoveEmptyStructXml() { + String xmlin = "" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmloutexpected = "" + + "\n" + + " \n" + + " blah\n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } + + @Test + public void testRemoveEmptyStructJson() { + String xmlin = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T3\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T4\":{\r\n" + + " \"T12\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T13\":[ ],\r\n" + + " \"T14\":{\r\n" + + " \"T15\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T16\":{\r\n" + + " \r\n" + + " }\r\n" + + " }\r\n" + + " },\r\n" + + " \"T5\":{\r\n" + + " \"T6\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T7\":[\r\n" + + " \"T8\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T9\":{ },\r\n" + + " \"T10\":\"blah\",\r\n" + + " \"T11\":[\r\n" + + " \r\n" + + " ]\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmloutexpected = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T5\":{\r\n" + + " \"T7\":[\r\n" + + " \"T10\":\"blah\",\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmlout = XmlJsonUtil.removeEmptyStructJson(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java new file mode 100644 index 000000000..8ff0b0a3f --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java @@ -0,0 +1,121 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.sshapicall; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestXmlParser { + + private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); + + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("project.dependencies.dependency"); + listNameList.add("project.build.plugins.plugin"); + listNameList.add("project.build.plugins.plugin.executions.execution"); + listNameList.add("project.build.pluginManagement.plugins.plugin"); + listNameList.add("project.build.pluginManagement." + + "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + + @Test + public void testValidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport[5]"), is("SET_RESET_LP")); + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport[0]"), is("SET_BVOIP_IN")); + + logProperties(mm); + in.close(); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("invalidlength.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } +} diff --git a/sshapi-call-node/.gitignore b/sshapi-call-node/.gitignore new file mode 100755 index 000000000..b73caf31e --- /dev/null +++ b/sshapi-call-node/.gitignore @@ -0,0 +1,34 @@ +#####standard .git ignore entries##### + +## IDE Specific Files ## +org.eclipse.core.resources.prefs +.classpath +.project +.settings +.idea +.externalToolBuilders +maven-eclipse.xml +workspace + +## Compilation Files ## +*.class +**/target +target +target-ide +MANIFEST.MF + +## Misc Ignores (OS specific etc) ## +bin/ +dist +*~ +*.ipr +*.iml +*.iws +classes +out/ +.DS_STORE +.metadata + +## Folders which contain auto generated source code ## +yang-gen-config +yang-gen-sal diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml new file mode 100644 index 000000000..12ec06867 --- /dev/null +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.plugins + ccsdk-sshapi-call-node + 0.3.0-SNAPSHOT + feature + + ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} + + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + ${odl.mdsal.model.version} + pom + import + + + org.opendaylight.controller + mdsal-artifacts + ${odl.mdsal.version} + pom + import + + + + + + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + sshapi-call-node-provider + ${project.version} + + + diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml new file mode 100644 index 000000000..a37ac6172 --- /dev/null +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.1.0-SNAPSHOT + + + + org.onap.ccsdk.sli.plugins + features-sshapi-call-node + 0.3.0-SNAPSHOT + feature + + ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} + + + + ${project.groupId} + ccsdk-sshapi-call-node + ${project.version} + xml + features + + + + diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml new file mode 100755 index 000000000..49b96e3fd --- /dev/null +++ b/sshapi-call-node/features/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.1.0-SNAPSHOT + + + org.onap.ccsdk.sli.plugins + sshapi-call-node-features + 0.3.0-SNAPSHOT + pom + + ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} + + + ccsdk-sshapi-call-node + features-sshapi-call-node + + diff --git a/sshapi-call-node/features/src/main/resources/features.xml b/sshapi-call-node/features/src/main/resources/features.xml new file mode 100644 index 000000000..573f5cb05 --- /dev/null +++ b/sshapi-call-node/features/src/main/resources/features.xml @@ -0,0 +1,51 @@ + + + + + + + + mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features + + + + sdnc-sli + spring + spring-dm + mvn:com.sun.jersey/jersey-client/${jersey.version} + + mvn:com.sun.jersey.contribs.jersey-oauth/oauth-signature/${jersey.version} + + + mvn:com.sun.jersey.contribs.jersey-oauth/oauth-client/${jersey.version} + + mvn:org.codehaus.jettison/jettison/${jettison.version} + + mvn:org.onap.ccsdk.sli.plugins/sshapi-call-node-provider/${project.version} + + + + diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml new file mode 100755 index 000000000..51bed972f --- /dev/null +++ b/sshapi-call-node/installer/pom.xml @@ -0,0 +1,148 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.1.0-SNAPSHOT + + + org.onap.ccsdk.sli.plugins + sshapi-call-node-installer + 0.3.0-SNAPSHOT + pom + + ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} + + + ccsdk-sshapi-call-node + ${application.name} + mvn:org.onap.ccsdk.sli.plugins/${features.boot}/${project.version}/xml/features + false + + + + + + org.onap.ccsdk.sli.plugins + ${application.name} + ${project.version} + xml + features + + + * + * + + + + + + org.onap.ccsdk.sli.plugins + sshapi-call-node-provider + ${project.version} + + + org.springframework + spring-beans + + + org.springframework + spring-context + + + + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli.core + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + + + + + + + + diff --git a/sshapi-call-node/installer/src/assembly/assemble_installer_zip.xml b/sshapi-call-node/installer/src/assembly/assemble_installer_zip.xml new file mode 100644 index 000000000..b2e792123 --- /dev/null +++ b/sshapi-call-node/installer/src/assembly/assemble_installer_zip.xml @@ -0,0 +1,59 @@ + + + + + + installer_zip + + zip + + + + false + + + + target/stage/ + ${application.name} + 755 + + *.sh + + + + target/stage/ + ${application.name} + 644 + + *.sh + + + + + + + diff --git a/sshapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml b/sshapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml new file mode 100644 index 000000000..2a6344697 --- /dev/null +++ b/sshapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -0,0 +1,49 @@ + + + + + + repo + + zip + + + + false + + + + target/assembly/ + . + + + + + + + + diff --git a/sshapi-call-node/installer/src/main/resources/scripts/install-feature.sh b/sshapi-call-node/installer/src/main/resources/scripts/install-feature.sh new file mode 100644 index 000000000..8e516a247 --- /dev/null +++ b/sshapi-call-node/installer/src/main/resources/scripts/install-feature.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2018 Samsung Electronics. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client} +INSTALLERDIR=$(dirname $0) + +REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip + +if [ -f ${REPOZIP} ] +then + unzip -nd ${ODL_HOME} ${REPOZIP} +else + echo "ERROR : repo zip ($REPOZIP) not found" + exit 1 +fi + +${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories} +${ODL_KARAF_CLIENT} feature:install ${features.boot} diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml new file mode 100755 index 000000000..91b52e123 --- /dev/null +++ b/sshapi-call-node/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.1.0-SNAPSHOT + + + org.onap.ccsdk.sli.plugins + sshapi-call-node + 0.3.0-SNAPSHOT + pom + + ccsdk-sli-plugins :: sshapi-call-node + This is an implementation of DG Execute Node that makes a call to an external REST API + + + provider + features + installer + + diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml new file mode 100755 index 000000000..165003ff1 --- /dev/null +++ b/sshapi-call-node/provider/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + binding-parent + 1.1.0-SNAPSHOT + + + org.onap.ccsdk.sli.plugins + sshapi-call-node-provider + 0.3.0-SNAPSHOT + bundle + + ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} + http://maven.apache.org + + + UTF-8 + + + + + junit + junit + test + + + org.springframework + spring-test + test + + + org.onap.ccsdk.sli.core + sli-common + + + org.onap.ccsdk.sli.core + sli-provider + + + org.slf4j + slf4j-api + + + org.springframework + spring-beans + + + org.springframework + spring-context + + + com.sun.jersey + jersey-client + + + com.sun.jersey.contribs.jersey-oauth + oauth-signature + ${jersey.version} + + + com.sun.jersey.contribs.jersey-oauth + oauth-client + ${jersey.version} + + + org.codehaus.jettison + jettison + + + diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/SshApiCallNode.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/SshApiCallNode.java new file mode 100644 index 000000000..4efddec80 --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/SshApiCallNode.java @@ -0,0 +1,84 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall; + +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import java.io.OutputStream; +import java.util.Map; + +public interface SshApiCallNode extends SvcLogicJavaPlugin { + + /** + * Allows Directed Graphs the ability to interact with SSH APIs. + * @param paramMap HashMap of parameters passed by the DG to this function + * + * + * + * + * + * + * + * + * + * + * vpn-information.vrf-details + * + * + * + * + *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to template file that can be used to build a request/sdncopt/bvc/sshapi/templates/vnf_service-configuration-operation_minimal.json
sshapiUrlMandatoryurl to make the SSH connection request to.
sshapiUserOptionaluser name to use for ssh basic authenticationsdnc_ws
sshapiPasswordOptionalunencrypted password to use for ssh basic authenticationplain_password
sshKeyOptionalConsumer SSH key to use for ssh authenticationplain_key
cmdMandatoryssh command to be executed on the server.get post put delete patch
responsePrefixOptionallocation the response will be written to in context memorytmp.sshapi.result
listName[i]OptionalUsed for processing XML responses with repeating elements.
convertResponse Optionalwhether the response should be convertedtrue or false
dumpHeadersOptionalwhen true writes ssh response content to context memorytrue or false
returnRequestPayloadOptionalused to return payload built in the requesttrue or false
+ * Exec remote command over SSH. Return command execution status. + * Command output is written to out or err stream. + * + * @param ctx Reference to context memory + */ + void execCommand(Map paramMap, SvcLogicContext ctx) throws SvcLogicException; + + /** + * Allows Directed Graphs the ability to interact with SSH APIs. + * @param paramMap HashMap of parameters passed by the DG to this function + * + * + * + * + * + * + * + * + * + * + * vpn-information.vrf-details + * + * + * + * + *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to template file that can be used to build a request/sdncopt/bvc/sshapi/templates/vnf_service-configuration-operation_minimal.json
sshapiUrlMandatoryurl to make the SSH connection request to.
sshapiUserOptionaluser name to use for ssh basic authenticationsdnc_ws
sshapiPasswordOptionalunencrypted password to use for ssh basic authenticationplain_password
sshKeyOptionalConsumer SSH key to use for ssh authenticationplain_key
cmdMandatoryssh command to be executed on the server.get post put delete patch
responsePrefixOptionallocation the response will be written to in context memorytmp.sshapi.result
listName[i]OptionalUsed for processing XML responses with repeating elements.
convertResponse Optionalwhether the response should be convertedtrue or false
dumpHeadersOptionalwhen true writes ssh response content to context memorytrue or false
returnRequestPayloadOptionalused to return payload built in the requesttrue or false
+ * Exec remote command over SSH with pseudo-tty. Return command execution status. + * Command output is written to out stream only as pseudo-tty writes to one stream only. + * + * @param ctx Reference to context memory + */ + void execCommandWithPty(Map paramMap, SvcLogicContext ctx) throws SvcLogicException ; + +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/AuthType.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/AuthType.java new file mode 100644 index 000000000..308162271 --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/AuthType.java @@ -0,0 +1,19 @@ +package org.onap.ccsdk.sli.plugins.sshapicall.impl; + +public enum AuthType { + NONE, BASIC, DIGEST, OAUTH, Unspecified; + + public static AuthType fromString(String s) { + if ("basic".equalsIgnoreCase(s)) + return BASIC; + if ("digest".equalsIgnoreCase(s)) + return DIGEST; + if ("oauth".equalsIgnoreCase(s)) + return OAUTH; + if ("none".equalsIgnoreCase(s)) + return NONE; + if ("unspecified".equalsIgnoreCase(s)) + return Unspecified; + throw new IllegalArgumentException("Invalid value for format: " + s); + } +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Format.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Format.java new file mode 100644 index 000000000..75604de66 --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Format.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.impl; + +public enum Format { + JSON, XML, NONE; + + public static Format fromString(String s) { + if ("json".equalsIgnoreCase(s)) + return JSON; + if ("xml".equalsIgnoreCase(s)) + return XML; + if ("none".equalsIgnoreCase(s)) + return NONE; + throw new IllegalArgumentException("Invalid value for format: " + s); + } +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Parameters.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Parameters.java new file mode 100644 index 000000000..a392cc73c --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Parameters.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.impl; + +import java.util.Set; + +public class Parameters { + public String templateFileName; + public String sshapiUrl; + public String sshapiUser; + public String sshapiPassword; + public Format sshKey; + public String cmd; + public String responsePrefix; + public Set listNameList; + public boolean convertResponse; + public Boolean dumpHeaders; + public String requestBody; + public AuthType authtype; + public Boolean returnRequestPayload; +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/SshapiCallNodeImpl.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/SshapiCallNodeImpl.java new file mode 100644 index 000000000..9283b8b5f --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/SshapiCallNodeImpl.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.impl; + +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.sshapicall.SshApiCallNode; + +import java.io.OutputStream; +import java.util.Map; + +public class SshapiCallNodeImpl implements SshApiCallNode { + @Override + public void execCommand(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + //TODO: Implementation + } + + @Override + public void execCommandWithPty(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + //TODO: Implementation + } +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/JsonParser.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/JsonParser.java new file mode 100644 index 000000000..e840053f8 --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/JsonParser.java @@ -0,0 +1,96 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.model; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.codehaus.jettison.json.JSONArray; +import org.codehaus.jettison.json.JSONException; +import org.codehaus.jettison.json.JSONObject; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public final class JsonParser { + + private static final Logger log = LoggerFactory.getLogger(JsonParser.class); + + private JsonParser() { + // Preventing instantiation of the same. + } + + @SuppressWarnings("unchecked") + public static Map convertToProperties(String s) + throws SvcLogicException { + + checkNotNull(s, "Input should not be null."); + + try { + JSONObject json = new JSONObject(s); + Map wm = new HashMap<>(); + Iterator ii = json.keys(); + while (ii.hasNext()) { + String key1 = ii.next(); + wm.put(key1, json.get(key1)); + } + + Map mm = new HashMap<>(); + + while (!wm.isEmpty()) + for (String key : new ArrayList<>(wm.keySet())) { + Object o = wm.get(key); + wm.remove(key); + + if (o instanceof Boolean || o instanceof Number || o instanceof String) { + mm.put(key, o.toString()); + + log.info("Added property: {} : {}", key, o.toString()); + } else if (o instanceof JSONObject) { + JSONObject jo = (JSONObject) o; + Iterator i = jo.keys(); + while (i.hasNext()) { + String key1 = i.next(); + wm.put(key + "." + key1, jo.get(key1)); + } + } else if (o instanceof JSONArray) { + JSONArray ja = (JSONArray) o; + mm.put(key + "_length", String.valueOf(ja.length())); + + log.info("Added property: {}_length: {}", key, String.valueOf(ja.length())); + + for (int i = 0; i < ja.length(); i++) + wm.put(key + '[' + i + ']', ja.get(i)); + } + } + return mm; + } catch (JSONException e) { + throw new SvcLogicException("Unable to convert JSON to properties" + e.getLocalizedMessage(), e); + } + } +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryException.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryException.java new file mode 100644 index 000000000..9a1d3a312 --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryException.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.model; + +public class RetryException extends Exception { + + public RetryException(String message) { + super(message); + } + +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicy.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicy.java new file mode 100644 index 000000000..fef0f81af --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicy.java @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.model; + +public class RetryPolicy { + private String[] hostnames; + private Integer maximumRetries; + + public Integer getMaximumRetries() { + return maximumRetries; + } + + public String getNextHostName(String uri) throws RetryException { + Integer position = null; + + for (int i = 0; i < hostnames.length; i++) { + if (uri.contains(hostnames[i])) { + position = i; + break; + } + } + + if(position == null){ + throw new RetryException("No match found for the provided uri[" + uri + "] " + + "so the next host name could not be retreived"); + } + position++; + + if (position > hostnames.length - 1) { + position = 0; + } + return hostnames[position]; + } + + public RetryPolicy(String[] hostnames, Integer maximumRetries){ + this.hostnames = hostnames; + this.maximumRetries = maximumRetries; + } + + +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicyStore.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicyStore.java new file mode 100644 index 000000000..65575b8ce --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicyStore.java @@ -0,0 +1,56 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.model; + +import java.util.HashMap; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RetryPolicyStore { + private static final Logger log = LoggerFactory.getLogger(RetryPolicyStore.class); + + HashMap retryPolicies; + public String proxyServers; + + public String getProxyServers() { + return proxyServers; + } + + public void setProxyServers(String admServers) { + this.proxyServers = admServers; + String[] adminServersArray = admServers.split(","); + RetryPolicy adminPortalRetry = new RetryPolicy(adminServersArray, adminServersArray.length); + retryPolicies.put("dme2proxy", adminPortalRetry); + } + + public RetryPolicyStore() { + retryPolicies = new HashMap<>(); + } + + public RetryPolicy getRetryPolicy(String policyName) { + return (this.retryPolicies.get(policyName)); + } + +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/XmlJsonUtil.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/XmlJsonUtil.java new file mode 100644 index 000000000..e7fc60edb --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/XmlJsonUtil.java @@ -0,0 +1,389 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.model; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public final class XmlJsonUtil { + + private static final Logger log = LoggerFactory.getLogger(XmlJsonUtil.class); + + private XmlJsonUtil() { + // Preventing instantiation of the same. + } + + public static String getXml(Map varmap, String var) { + boolean escape = true; + if (var.startsWith("'")) { + var = var.substring(1); + escape = false; + } + + Object o = createStructure(varmap, var); + return generateXml(o, 0, escape); + } + + public static String getJson(Map varmap, String var) { + boolean escape = true; + if (var.startsWith("'")) { + var = var.substring(1); + escape = false; + } + + boolean quotes = true; + if (var.startsWith("\"")) { + var = var.substring(1); + quotes = false; + } + + Object o = createStructure(varmap, var); + return generateJson(o, escape, quotes); + } + + private static Object createStructure(Map flatmap, String var) { + if (flatmap.containsKey(var)) { + if (var.endsWith("_length") || var.endsWith("].key")) + return null; + return flatmap.get(var); + } + + Map mm = new HashMap<>(); + for (String k : flatmap.keySet()) + if (k.startsWith(var + ".")) { + int i1 = k.indexOf('.', var.length() + 1); + int i2 = k.indexOf('[', var.length() + 1); + int i3 = k.length(); + if (i1 > 0 && i1 < i3) + i3 = i1; + if (i2 > 0 && i2 < i3) + i3 = i2; + String k1 = k.substring(var.length() + 1, i3); + String var1 = k.substring(0, i3); + if (!mm.containsKey(k1)) { + Object str = createStructure(flatmap, var1); + if (str != null && (!(str instanceof String) || ((String) str).trim().length() > 0)) + mm.put(k1, str); + } + } + if (!mm.isEmpty()) + return mm; + + boolean arrayFound = false; + for (String k : flatmap.keySet()) + if (k.startsWith(var + "[")) { + arrayFound = true; + break; + } + + if (arrayFound) { + List ll = new ArrayList<>(); + + int length = Integer.MAX_VALUE; + String lengthStr = flatmap.get(var + "_length"); + if (lengthStr != null) { + try { + length = Integer.parseInt(lengthStr); + } catch (Exception e) { + log.warn("Invalid number for {}_length:{}", var, lengthStr, e); + } + } + + for (int i = 0; i < length; i++) { + Object v = createStructure(flatmap, var + '[' + i + ']'); + if (v == null) + break; + ll.add(v); + } + + if (!ll.isEmpty()) + return ll; + } + + return null; + } + + @SuppressWarnings("unchecked") + private static String generateXml(Object o, int indent, boolean escape) { + if (o == null) + return null; + + if (o instanceof String) + return escape ? escapeXml((String) o) : (String) o;; + + if (o instanceof Map) { + StringBuilder ss = new StringBuilder(); + Map mm = (Map) o; + for (Map.Entry entry: mm.entrySet()) { + Object v = entry.getValue(); + String key = entry.getKey(); + if (v instanceof String) { + String s = escape ? escapeXml((String) v) : (String) v; + ss.append(pad(indent)).append('<').append(key).append('>'); + ss.append(s); + ss.append("').append('\n'); + } else if (v instanceof Map) { + ss.append(pad(indent)).append('<').append(key).append('>').append('\n'); + ss.append(generateXml(v, indent + 1, escape)); + ss.append(pad(indent)).append("').append('\n'); + } else if (v instanceof List) { + List ll = (List) v; + for (Object o1 : ll) { + ss.append(pad(indent)).append('<').append(key).append('>').append('\n'); + ss.append(generateXml(o1, indent + 1, escape)); + ss.append(pad(indent)).append("').append('\n'); + } + } + } + return ss.toString(); + } + + return null; + } + + private static String generateJson(Object o, boolean escape, boolean quotes) { + if (o == null) + return null; + + StringBuilder ss = new StringBuilder(); + generateJson(ss, o, 0, false, escape, quotes); + return ss.toString(); + } + + @SuppressWarnings("unchecked") + private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape, boolean quotes) { + if (o instanceof String) { + String s = escape ? escapeJson((String) o) : (String) o; + if (padFirst) + ss.append(pad(indent)); + if (quotes) { + ss.append('"').append(s).append('"'); + } else { + ss.append(s); + } + return; + } + + if (o instanceof Map) { + Map mm = (Map) o; + + if (padFirst) + ss.append(pad(indent)); + ss.append("{\n"); + + boolean first = true; + for (Map.Entry entry : mm.entrySet()) { + if (!first) + ss.append(",\n"); + first = false; + Object v = entry.getValue(); + String key = entry.getKey(); + ss.append(pad(indent + 1)).append('"').append(key).append("\": "); + generateJson(ss, v, indent + 1, false, escape, true); + } + + ss.append("\n"); + ss.append(pad(indent)).append('}'); + + return; + } + + if (o instanceof List) { + List ll = (List) o; + + if (padFirst) + ss.append(pad(indent)); + ss.append("[\n"); + + boolean first = true; + for (Object o1 : ll) { + if (!first) + ss.append(",\n"); + first = false; + + generateJson(ss, o1, indent + 1, true, escape, quotes); + } + + ss.append("\n"); + ss.append(pad(indent)).append(']'); + } + } + + public static String removeLastCommaJson(String s) { + StringBuilder sb = new StringBuilder(); + int k = 0; + int start = 0; + while (k < s.length()) { + int i11 = s.indexOf('}', k); + int i12 = s.indexOf(']', k); + int i1 = -1; + if (i11 < 0) + i1 = i12; + else if (i12 < 0) + i1 = i11; + else + i1 = i11 < i12 ? i11 : i12; + if (i1 < 0) + break; + + int i2 = s.lastIndexOf(',', i1); + if (i2 < 0) { + k = i1 + 1; + continue; + } + + String between = s.substring(i2 + 1, i1); + if (between.trim().length() > 0) { + k = i1 + 1; + continue; + } + + sb.append(s.substring(start, i2)); + start = i2 + 1; + k = i1 + 1; + } + + sb.append(s.substring(start, s.length())); + + return sb.toString(); + } + + public static String removeEmptyStructJson(String s) { + int k = 0; + while (k < s.length()) { + boolean curly = true; + int i11 = s.indexOf('{', k); + int i12 = s.indexOf('[', k); + int i1 = -1; + if (i11 < 0) { + i1 = i12; + curly = false; + } else if (i12 < 0) + i1 = i11; + else + if (i11 < i12) + i1 = i11; + else { + i1 = i12; + curly = false; + } + + if (i1 >= 0) { + int i2 = curly ? s.indexOf('}', i1) : s.indexOf(']', i1); + if (i2 > 0) { + String value = s.substring(i1 + 1, i2); + if (value.trim().length() == 0) { + int i4 = s.lastIndexOf('\n', i1); + if (i4 < 0) + i4 = 0; + int i5 = s.indexOf('\n', i2); + if (i5 < 0) + i5 = s.length(); + + s = s.substring(0, i4) + s.substring(i5); + k = 0; + } else + k = i1 + 1; + } else + break; + } else + break; + } + + return s; + } + + public static String removeEmptyStructXml(String s) { + int k = 0; + while (k < s.length()) { + int i1 = s.indexOf('<', k); + if (i1 < 0 || i1 == s.length() - 1) + break; + + char c1 = s.charAt(i1 + 1); + if (c1 == '?' || c1 == '!') { + k = i1 + 2; + continue; + } + + int i2 = s.indexOf('>', i1); + if (i2 < 0) { + k = i1 + 1; + continue; + } + + String closingTag = " 0) { + k = i2 + 1; + continue; + } + + int i4 = s.lastIndexOf('\n', i1); + if (i4 < 0) + i4 = 0; + int i5 = s.indexOf('\n', i3); + if (i5 < 0) + i5 = s.length(); + + s = s.substring(0, i4) + s.substring(i5); + k = 0; + } + + return s; + } + + private static String escapeXml(String v) { + String s = v.replaceAll("&", "&"); + s = s.replaceAll("<", "<"); + s = s.replaceAll("'", "'"); + s = s.replaceAll("\"", """); + s = s.replaceAll(">", ">"); + return s; + } + + private static String escapeJson(String v) { + String s = v.replaceAll("\\\\", "\\\\\\\\"); + s = s.replaceAll("\"", "\\\\\""); + return s; + } + + private static String pad(int n) { + StringBuilder s = new StringBuilder(); + for (int i = 0; i < n; i++) + s.append(Character.toString('\t')); + return s.toString(); + } +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/XmlParser.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/XmlParser.java new file mode 100644 index 000000000..c23aca6cf --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/XmlParser.java @@ -0,0 +1,174 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.model; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public final class XmlParser { + + private static final Logger log = LoggerFactory.getLogger(XmlParser.class); + + private XmlParser() { + // Preventing instantiation of the same. + } + + public static Map convertToProperties(String s, Set listNameList) + throws SvcLogicException { + + checkNotNull(s, "Input should not be null."); + + Handler handler = new Handler(listNameList); + try { + SAXParserFactory factory = SAXParserFactory.newInstance(); + SAXParser saxParser = factory.newSAXParser(); + InputStream in = new ByteArrayInputStream(s.getBytes()); + saxParser.parse(in, handler); + } catch (ParserConfigurationException | IOException | SAXException | NumberFormatException e) { + throw new SvcLogicException("Unable to convert XML to properties" + e.getLocalizedMessage(), e); + } + return handler.getProperties(); + } + + private static class Handler extends DefaultHandler { + + private Set listNameList; + + private Map properties = new HashMap<>(); + + public Map getProperties() { + return properties; + } + + public Handler(Set listNameList) { + super(); + this.listNameList = listNameList; + if (this.listNameList == null) + this.listNameList = new HashSet<>(); + } + + StringBuilder currentName = new StringBuilder(); + StringBuilder currentValue = new StringBuilder(); + + @Override + public void startElement(String uri, String localName, String qName, Attributes attributes) + throws SAXException { + super.startElement(uri, localName, qName, attributes); + + String name = localName; + if (name == null || name.trim().length() == 0) + name = qName; + int i2 = name.indexOf(':'); + if (i2 >= 0) + name = name.substring(i2 + 1); + + if (currentName.length() > 0) + currentName.append(Character.toString('.')); + currentName.append(name); + + String listName = removeIndexes(currentName.toString()); + + if (listNameList.contains(listName)) { + String n = currentName.toString() + "_length"; + int len = getInt(properties, n); + properties.put(n, String.valueOf(len + 1)); + currentName.append("[").append(len).append("]"); + } + } + + @Override + public void endElement(String uri, String localName, String qName) throws SAXException { + super.endElement(uri, localName, qName); + + String name = localName; + if (name == null || name.trim().length() == 0) + name = qName; + int i2 = name.indexOf(':'); + if (i2 >= 0) + name = name.substring(i2 + 1); + + String s = currentValue.toString().trim(); + if (s.length() > 0) { + properties.put(currentName.toString(), s); + + log.info("Added property: {} : {}", currentName, s); + currentValue = new StringBuilder(); + } + + int i1 = currentName.lastIndexOf("." + name); + if (i1 <= 0) + currentName = new StringBuilder(); + else + currentName = new StringBuilder(currentName.substring(0, i1)); + } + + @Override + public void characters(char[] ch, int start, int length) throws SAXException { + super.characters(ch, start, length); + + String value = new String(ch, start, length); + currentValue.append(value); + } + + private static int getInt(Map mm, String name) { + String s = mm.get(name); + if (s == null) + return 0; + return Integer.parseInt(s); + } + + private String removeIndexes(String currentName) { + StringBuilder b = new StringBuilder(); + boolean add = true; + for (int i = 0; i < currentName.length(); i++) { + char c = currentName.charAt(i); + if (c == '[') + add = false; + else if (c == ']') + add = true; + else if (add) + b.append(Character.toString(c)); + } + return b.toString(); + } + } +} diff --git a/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-context.xml b/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-context.xml new file mode 100644 index 000000000..4cce6ffad --- /dev/null +++ b/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-context.xml @@ -0,0 +1,51 @@ + + + + + + + + + file:${SDNC_CONFIG_DIR}/ueb.properties + file:${SDNC_CONFIG_DIR}/dme2.properties + + + + + + + + + + + + + + + + + diff --git a/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-osgi-context.xml b/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-osgi-context.xml new file mode 100644 index 000000000..c8e9a99e3 --- /dev/null +++ b/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-osgi-context.xml @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/sshapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/sshapi-call-node-blueprint.xml b/sshapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/sshapi-call-node-blueprint.xml new file mode 100755 index 000000000..b24aaf1ee --- /dev/null +++ b/sshapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/sshapi-call-node-blueprint.xml @@ -0,0 +1,16 @@ + + + + + + + + + + org.onap.ccsdk.sli.plugins.sshapicall.SshApiCallNode + + + + \ No newline at end of file diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java new file mode 100644 index 000000000..9df790ae3 --- /dev/null +++ b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.sshapicall; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.sshapicall.model.JsonParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestJsonParser { + + private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); + + @Test + public void test() throws SvcLogicException, IOException { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Map mm = JsonParser.convertToProperties(b.toString()); + + logProperties(mm); + + in.close(); + } + + @Test(expected = NullPointerException.class) + public void testNullString() throws SvcLogicException { + JsonParser.convertToProperties(null); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + log.info("Properties:"); + for (String name : ll) + log.info("--- {}: {}", name, mm.get(name)); + } +} diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java new file mode 100644 index 000000000..599043e9c --- /dev/null +++ b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java @@ -0,0 +1,264 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.sshapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; +import org.onap.ccsdk.sli.plugins.sshapicall.model.XmlJsonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class TestXmlJsonUtil { + + private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); + + @Test + public void test() { + Map mm = new HashMap<>(); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); + mm.put("service-data.service-information.service-instance-id", "someinstance001"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3_length", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf_length", "1"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", + "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); + + mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); + mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); + mm.put("service-data.vnf-config-information.vendor", "Netconf"); + + mm.put("service-data.vnf-config-information.escape-test", + "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); + + String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); + log.info(ss); + + ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + } + + @Test + public void testRemoveEmptyStructXml() { + String xmlin = "" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmloutexpected = "" + + "\n" + + " \n" + + " blah\n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } + + @Test + public void testRemoveEmptyStructJson() { + String xmlin = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T3\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T4\":{\r\n" + + " \"T12\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T13\":[ ],\r\n" + + " \"T14\":{\r\n" + + " \"T15\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T16\":{\r\n" + + " \r\n" + + " }\r\n" + + " }\r\n" + + " },\r\n" + + " \"T5\":{\r\n" + + " \"T6\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T7\":[\r\n" + + " \"T8\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T9\":{ },\r\n" + + " \"T10\":\"blah\",\r\n" + + " \"T11\":[\r\n" + + " \r\n" + + " ]\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmloutexpected = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T5\":{\r\n" + + " \"T7\":[\r\n" + + " \"T10\":\"blah\",\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmlout = XmlJsonUtil.removeEmptyStructJson(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } +} diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java new file mode 100644 index 000000000..d904721f8 --- /dev/null +++ b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java @@ -0,0 +1,123 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.sshapicall; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.sshapicall.model.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestXmlParser { + + private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); + + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("project.dependencies.dependency"); + listNameList.add("project.build.plugins.plugin"); + listNameList.add("project.build.plugins.plugin.executions.execution"); + listNameList.add("project.build.pluginManagement.plugins.plugin"); + listNameList.add("project.build.pluginManagement." + + "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + + @Test + public void testValidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport[5]"), is("SET_RESET_LP")); + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport[0]"), is("SET_BVOIP_IN")); + + logProperties(mm); + in.close(); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("invalidlength.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } +} diff --git a/sshapi-call-node/provider/src/test/resources/invalidlength.xml b/sshapi-call-node/provider/src/test/resources/invalidlength.xml new file mode 100644 index 000000000..b71f6391f --- /dev/null +++ b/sshapi-call-node/provider/src/test/resources/invalidlength.xml @@ -0,0 +1,49 @@ + + + + + + ICOREPVC-81114561 + + VPNL811182 + 811182 + 21302:811182 + SET_BVOIP_IN + SET6_BVOIP_IN + a + SET6_DSU + SET_DSU + SET6_MANAGED + SET_MANAGED + SET_LOVRF_COMMUNITY + SET_RESET_LP + + AG_MAX_MCASTROUTES + + + + 200 + Success + Y + + diff --git a/sshapi-call-node/provider/src/test/resources/test-template.json b/sshapi-call-node/provider/src/test/resources/test-template.json new file mode 100644 index 000000000..cd5e74699 --- /dev/null +++ b/sshapi-call-node/provider/src/test/resources/test-template.json @@ -0,0 +1,57 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "sdn-circuit-request": [ + ${repeat:tmp.sdn-circuit-req-row_length: + { + "request-id": ${tmp.sdn-circuit-req-row[${1}].request-id}, + "source-uid": ${tmp.sdn-circuit-req-row[${1}].source-uid}, + "action": ${tmp.sdn-circuit-req-row[${1}].action}, + "request-timestamp": ${tmp.sdn-circuit-req-row[${1}].request-timestamp}, + "update-timestamp": ${tmp.sdn-circuit-req-row[${1}].update-timestamp}, + "request-status": ${tmp.sdn-circuit-req-row[${1}].request-status}, + "processing-status": ${tmp.sdn-circuit-req-row[${1}].processing-status}, + "reason-code": ${tmp.sdn-circuit-req-row[${1}].reason-code}, + "reason-message": ${tmp.sdn-circuit-req-row[${1}].reason-message}, + "customer-code": ${tmp.sdn-circuit-req-row[${1}].customer-code}, + "bundle-id": ${tmp.sdn-circuit-req-row[${1}].bundle-id}, + "router-name-1": ${tmp.sdn-circuit-req-row[${1}].router-name-1}, + "tail-clfi-1": ${tmp.sdn-circuit-req-row[${1}].tail-clfi-1}, + "srg-1": ${tmp.sdn-circuit-req-row[${1}].srg-1}, + "router-name-2": ${tmp.sdn-circuit-req-row[${1}].router-name-2}, + "tail-clfi-2": ${tmp.sdn-circuit-req-row[${1}].tail-clfi-2}, + "srg-2": ${tmp.sdn-circuit-req-row[${1}].srg-2}, + "facility-speed": ${tmp.sdn-circuit-req-row[${1}].facility-speed}, + "facility-speed-units": ${tmp.sdn-circuit-req-row[${1}].facility-speed-units}, + "facility-type": ${tmp.sdn-circuit-req-row[${1}].facility-type}, + "service-clfi": ${tmp.sdn-circuit-req-row[${1}].service-clfi}, + "clci": ${tmp.sdn-circuit-req-row[${1}].clci}, + "wavelength-purpose": ${tmp.sdn-circuit-req-row[${1}].wavelength-purpose}, + "activate-setting": ${tmp.sdn-circuit-req-row[${1}].activate-setting}, + "apply-date": ${tmp.sdn-circuit-req-row[${1}].apply-date}, + "run-id": ${tmp.sdn-circuit-req-row[${1}].run-id}, + "hostname": ${tmp.sdn-circuit-req-row[${1}].hostname}, + "algo-request-reason": ${tmp.sdn-circuit-req-row[${1}].algo-request-reason} + }, + } + ] +} diff --git a/sshapi-call-node/provider/src/test/resources/test.json b/sshapi-call-node/provider/src/test/resources/test.json new file mode 100644 index 000000000..e272d457a --- /dev/null +++ b/sshapi-call-node/provider/src/test/resources/test.json @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +{ + "equipment-data": [ + { + "server-count": "4", + "max-server-speed": "1600000", + "number-primary-servers": "2", + "equipment-id": "Server1", + "server-model": "Unknown", + "server-id": "Server1", + "test-node" : { + "test-inner-node" : "Test-Value" + } + } + ], + "resource-state": { + "threshold-value": "1600000", + "last-added": "1605000", + "used": "1605000", + "limit-value": "1920000" + }, + "resource-rule": { + "endpoint-position": "VCE-Cust", + "soft-limit-expression": "0.6 * max-server-speed * number-primary-servers", + "resource-name": "Bandwidth", + "service-model": "DUMMY", + "hard-limit-expression": "max-server-speed * number-primary-servers", + "equipment-level": "Server" + }, + "message": "The provisioned access bandwidth is at or exceeds 50% of the total server capacity." +} diff --git a/sshapi-call-node/provider/src/test/resources/test.xml b/sshapi-call-node/provider/src/test/resources/test.xml new file mode 100644 index 000000000..7645f1992 --- /dev/null +++ b/sshapi-call-node/provider/src/test/resources/test.xml @@ -0,0 +1,184 @@ + + + + + 4.0.0 + + org.onap.ccsdk.sli.plugins + sshapi-call-node + 6.0.0-SNAPSHOT + + sshapi-call-node-provider + bundle + SSHAPI Call Node - Provider + http://maven.apache.org + + UTF-8 + + + + junit + junit + test + + + org.springframework + spring-test + 3.1.4.RELEASE + test + + + org.onap.ccsdk.sli + sli-common + compile + + + org.onap.ccsdk.sli + sli-provider + compile + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.springframework + spring-beans + 3.1.4.RELEASE + + + org.springframework + spring-context + 3.1.4.RELEASE + + + xerces + xerces + 2.4.0 + provided + + + com.sun.jersey + jersey-client + 1.17 + + + com.sun.jersey.contribs.jersey-oauth + oauth-signature + 1.17 + + + com.sun.jersey.contribs.jersey-oauth + oauth-client + 1.17 + + + commons-codec + commons-codec + + + + + + + com.brocade.developer + providermodule-plugin + + org.onap.ccsdk.sli.plugins + sshapi-call-node + + + + process-sources + + process + + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.onap.ccsdk.sli.plugins.sshapicall + org.onap.ccsdk.sli.plugins.sshapicall + * + + + ${project.basedir}/src/main/resources/META-INF + + + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + com.brocade.developer + + + providermodule-plugin + + + [1.2.0.100-SNAPSHOT,) + + + process + + + + + + + + + + + + + + diff --git a/sshapi-call-node/provider/src/test/resources/test3.xml b/sshapi-call-node/provider/src/test/resources/test3.xml new file mode 100644 index 000000000..52a7a7d98 --- /dev/null +++ b/sshapi-call-node/provider/src/test/resources/test3.xml @@ -0,0 +1,82 @@ + + + + + + ICOREPVC-81114561 + + VPNL811182 + 811182 + 21302:811182 + SET_BVOIP_IN + SET6_BVOIP_IN + SET6_DSU + SET_DSU + SET6_MANAGED + SET_MANAGED + SET_LOVRF_COMMUNITY + SET_RESET_LP + + AG_MAX_MCASTROUTES + + + + BGP4_PROTOCOL + v4 + gp_21302:811182 + + AG_L3VPN_EBGP + + + AG_MAX_PREFIX + + + AG_BGP_UNMANAGED + + + AG_BFD_BGP_3000 + + + + BGP4_PROTOCOL + v6 + gp6_21302:811182 + + AG6_L3VPN_EBGP + + + AG6_MAX_PREFIX + + + AG6_BGP_UNMANAGED + + + AG6_BFD_BGP_3000 + + + + 200 + Success + Y + + -- cgit 1.2.3-korg From 8b39ca99c8a49197b05f8fea7de9a1606c810e63 Mon Sep 17 00:00:00 2001 From: Ganesh Chandrasekaran Date: Tue, 24 Jul 2018 16:40:14 +0900 Subject: SSHApiCallNode sshExec API Impl Issue-ID: CCSDK-385 Change-Id: I430f9075ced10edb49062fc12091774e91611b32 Signed-off-by: Ganesh Chandrasekaran --- .../sli/plugins/restapicall/RestapiCallNode.java | 2 +- .../features/ccsdk-sshapi-call-node/pom.xml | 3 +- sshapi-call-node/provider/pom.xml | 10 + .../sli/plugins/sshapicall/SshApiCallNode.java | 226 ++++++++++++++--- .../sli/plugins/sshapicall/impl/AuthType.java | 19 -- .../ccsdk/sli/plugins/sshapicall/impl/Format.java | 39 --- .../sli/plugins/sshapicall/impl/Parameters.java | 42 ---- .../sshapicall/impl/SshapiCallNodeImpl.java | 43 ---- .../sli/plugins/sshapicall/model/AuthType.java | 41 +++ .../ccsdk/sli/plugins/sshapicall/model/Format.java | 39 +++ .../sli/plugins/sshapicall/model/JsonParser.java | 6 +- .../sli/plugins/sshapicall/model/Parameters.java | 45 ++++ .../sli/plugins/sshapicall/model/ParseParam.java | 274 +++++++++++++++++++++ .../plugins/sshapicall/model/RetryException.java | 32 --- .../sli/plugins/sshapicall/model/RetryPolicy.java | 62 ----- .../plugins/sshapicall/model/RetryPolicyStore.java | 56 ----- .../META-INF/spring/sshapi-call-node-context.xml | 6 +- .../spring/sshapi-call-node-osgi-context.xml | 2 +- .../blueprint/sshapi-call-node-blueprint.xml | 2 +- .../sli/plugins/sshapicall/TestJsonParser.java | 16 +- 20 files changed, 623 insertions(+), 342 deletions(-) delete mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/AuthType.java delete mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Format.java delete mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Parameters.java delete mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/SshapiCallNodeImpl.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/AuthType.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/Format.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/Parameters.java create mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/ParseParam.java delete mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryException.java delete mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicy.java delete mode 100644 sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicyStore.java (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 5168b3ec1..42462f0e6 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -90,7 +90,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { /** * Allows Directed Graphs the ability to interact with REST APIs. - * @param parameters HashMap of parameters passed by the DG to this function + * @param paramMap HashMap of parameters passed by the DG to this function * * * diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index 12ec06867..7b74d6de9 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -36,7 +36,7 @@ - + diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 165003ff1..e380d7c25 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -39,6 +39,16 @@ org.onap.ccsdk.sli.coresli-provider + + org.onap.appc + appc-ssh-adapter-api + 1.3.0 + provided + + + org.json + json + org.slf4j slf4j-api diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/SshApiCallNode.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/SshApiCallNode.java index 4efddec80..e4b082cda 100644 --- a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/SshApiCallNode.java +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/SshApiCallNode.java @@ -1,10 +1,11 @@ /*- * ============LICENSE_START======================================================= - * openECOMP : SDN-C + * ONAP : APPC * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Copyright (C) 2017 Amdocs + * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,36 +17,89 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. + * * ============LICENSE_END========================================================= */ package org.onap.ccsdk.sli.plugins.sshapicall; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +//import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.ByteArrayOutputStream; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import com.google.common.base.Strings; +import org.json.JSONObject; +import org.onap.appc.adapter.ssh.SshAdapter; +import org.onap.appc.adapter.ssh.SshConnection; import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; -import java.io.OutputStream; -import java.util.Map; +import org.onap.ccsdk.sli.plugins.sshapicall.model.AuthType; +import org.onap.ccsdk.sli.plugins.sshapicall.model.Parameters; +import org.onap.ccsdk.sli.plugins.sshapicall.model.ParseParam; + + +public class SshApiCallNode implements SvcLogicJavaPlugin { + + private static final EELFLogger logger = EELFManager.getInstance().getApplicationLogger(); + + /** + * Output parameter - SSH command execution status. + */ + String PARAM_OUT_status = "status"; + + /** + * Output parameter - content of SSH command stdout. + */ + String PARAM_OUT_stdout = "stdout"; + + /** + * Output parameter - content of SSH command stderr. + */ + String PARAM_OUT_stderr = "stderr"; + + /** + * Default success status. + */ + int DEF_SUCCESS_STATUS = 0; + + private SshAdapter sshAdapter; -public interface SshApiCallNode extends SvcLogicJavaPlugin { + public void setSshAdapter(SshAdapter sshAdapter) { + this.sshAdapter = sshAdapter; + } /** * Allows Directed Graphs the ability to interact with SSH APIs. - * @param paramMap HashMap of parameters passed by the DG to this function + * @param params HashMap of parameters passed by the DG to this function *
parameterMandatory/Optionaldescriptionexample values
* * * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * * vpn-information.vrf-details - * - * - * + * + * + * + * * *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to template file that can be used to build a request/sdncopt/bvc/sshapi/templates/vnf_service-configuration-operation_minimal.json
sshapiUrlMandatoryurl to make the SSH connection request to.
sshapiUserOptionaluser name to use for ssh basic authenticationsdnc_ws
sshapiPasswordOptionalunencrypted password to use for ssh basic authenticationplain_password
sshKeyOptionalConsumer SSH key to use for ssh authenticationplain_key
cmdMandatoryssh command to be executed on the server.get post put delete patch
responsePrefixOptionallocation the response will be written to in context memorytmp.sshapi.result
UrlMandatoryurl to make the SSH connection request to.
PortMandatoryport to make the SSH connection request to.
UserOptionaluser name to use for ssh basic authenticationsdnc_ws
PasswordOptionalunencrypted password to use for ssh basic authenticationplain_password
SshKeyOptionalConsumer SSH key to use for ssh authenticationplain_key
ExecTimeoutOptionalSSH command execution timeoutplain_key
RetryOptionalMake ssh connection with default retry policyplain_key
CmdMandatoryssh command to be executed on the server.get post put delete patch
ResponsePrefixOptionallocation the response will be written to in context memorytmp.sshapi.result
ResponseTypeOptionalIf we know the response is to be in a specific format (supported are JSON, XML and NONE) tmp.sshapi.result
listName[i]OptionalUsed for processing XML responses with repeating elements.
convertResponse Optionalwhether the response should be convertedtrue or false
dumpHeadersOptionalwhen true writes ssh response content to context memorytrue or false
returnRequestPayloadOptionalused to return payload built in the requesttrue or false
ConvertResponse Optionalwhether the response should be convertedtrue or false
AuthTypeOptionalType of authentiation to be used BASIC or sshKey basedtrue or false
EnvParametersOptionalA JSON dictionary which should list key value pairs to be passed to the command execution. + * These values would correspond to instance specific parameters that a command may need to execute an action.
FileParametersOptionalA JSON dictionary where keys are filenames and values are contents of files. + * The SSH Server will utilize this feature to generate files with keys as filenames and values as content. + * This attribute can be used to generate files that a command may require as part of execution.
* Exec remote command over SSH. Return command execution status. @@ -53,32 +107,140 @@ public interface SshApiCallNode extends SvcLogicJavaPlugin { * * @param ctx Reference to context memory */ - void execCommand(Map paramMap, SvcLogicContext ctx) throws SvcLogicException; + + public void execCommand(Map params, SvcLogicContext ctx) throws SvcLogicException { + ParseParam parser = new ParseParam(); + Parameters p = parser.getParameters(params); + logger.debug("=> Connecting to SSH server..."); + SshConnection sshConnection = getSshConnection(p); + sshConnection.connect(); + try { + logger.debug("=> Connected to SSH server..."); + logger.debug("=> Running SSH command..."); + sshConnection.setExecTimeout(p.sshExecTimeout); + ByteArrayOutputStream stdout = new ByteArrayOutputStream(); + ByteArrayOutputStream stderr = new ByteArrayOutputStream(); + int status = sshConnection.execCommand(parser.makeCommand(params), stdout, stderr); + String stdoutRes = stdout.toString(); + String stderrRes = stderr.toString(); + logger.debug("=> executed SSH command"); + + if(status == DEF_SUCCESS_STATUS) { + parser.parseOutput(ctx, stdoutRes); + } + ctx.setAttribute(PARAM_OUT_status, String.format("%01d", status)); + ctx.setAttribute(PARAM_OUT_stdout, stdoutRes); + ctx.setAttribute(PARAM_OUT_stderr, stderrRes); + } finally { + sshConnection.disconnect(); + } + } + + private SshConnection getSshConnection(Parameters p) throws SvcLogicException{ + if (p.authtype == AuthType.BASIC) + return sshAdapter.getConnection(p.sshapiUrl, p.sshapiPort, p.sshapiUser, p.sshapiPassword); + // This is not supported yet in the API, patch has already been added to APPC + else if (p.authtype == AuthType.KEY){ + //return sshAdapter.getConnection(p.sshapiUrl, p.sshapiPort, p.sshKey); + throw new SvcLogicException("SSH Key based Auth method not supported"); + } + else if (p.authtype == AuthType.NONE){ + //return sshAdapter.getConnection(p.sshapiUrl, p.sshapiPort, p.sshKey); + throw new SvcLogicException("SSH Auth type required, BASIC auth in support"); + } + else if (p.authtype == AuthType.UNSPECIFIED){ + if (p.sshapiUser != null && p.sshapiPassword != null) + return sshAdapter.getConnection(p.sshapiUrl, p.sshapiPort, p.sshapiUser, p.sshapiPassword); + else if (p.sshKey != null) + throw new SvcLogicException("SSH Key based Auth method not supported"); + } + throw new SvcLogicException("SSH Auth type required, BASIC auth in support"); + } + /** * Allows Directed Graphs the ability to interact with SSH APIs. - * @param paramMap HashMap of parameters passed by the DG to this function + * @param params HashMap of parameters passed by the DG to this function * * * * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * * vpn-information.vrf-details - * - * - * + * + * + * + * * *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to template file that can be used to build a request/sdncopt/bvc/sshapi/templates/vnf_service-configuration-operation_minimal.json
sshapiUrlMandatoryurl to make the SSH connection request to.
sshapiUserOptionaluser name to use for ssh basic authenticationsdnc_ws
sshapiPasswordOptionalunencrypted password to use for ssh basic authenticationplain_password
sshKeyOptionalConsumer SSH key to use for ssh authenticationplain_key
cmdMandatoryssh command to be executed on the server.get post put delete patch
responsePrefixOptionallocation the response will be written to in context memorytmp.sshapi.result
UrlMandatoryurl to make the SSH connection request to.
PortMandatoryport to make the SSH connection request to.
UserOptionaluser name to use for ssh basic authenticationsdnc_ws
PasswordOptionalunencrypted password to use for ssh basic authenticationplain_password
SshKeyOptionalConsumer SSH key to use for ssh authenticationplain_key
ExecTimeoutOptionalSSH command execution timeoutplain_key
RetryOptionalMake ssh connection with default retry policyplain_key
CmdMandatoryssh command to be executed on the server.get post put delete patch
ResponsePrefixOptionallocation the response will be written to in context memorytmp.sshapi.result
ResponseTypeOptionalIf we know the response is to be in a specific format (supported are JSON, XML and NONE) tmp.sshapi.result
listName[i]OptionalUsed for processing XML responses with repeating elements.
convertResponse Optionalwhether the response should be convertedtrue or false
dumpHeadersOptionalwhen true writes ssh response content to context memorytrue or false
returnRequestPayloadOptionalused to return payload built in the requesttrue or false
ConvertResponse Optionalwhether the response should be convertedtrue or false
AuthTypeOptionalType of authentiation to be used BASIC or sshKey basedtrue or false
EnvParametersOptionalA JSON dictionary which should list key value pairs to be passed to the command execution. + * These values would correspond to instance specific parameters that a command may need to execute an action.
FileParametersOptionalA JSON dictionary where keys are filenames and values are contents of files. + * The SSH Server will utilize this feature to generate files with keys as filenames and values as content. + * This attribute can be used to generate files that a command may require as part of execution.
- * Exec remote command over SSH with pseudo-tty. Return command execution status. - * Command output is written to out stream only as pseudo-tty writes to one stream only. + * Exec remote command over SSH. Return command execution status. + * Command output is written to out or err stream. * - * @param ctx Reference to context memory + * @param ctx Reference to context memory + */ + + public void execWithStatusCheck(Map params, SvcLogicContext ctx) throws SvcLogicException { + execCommand(params, ctx); + int status = Integer.parseInt(ctx.getAttribute(PARAM_OUT_status)); + if(status != DEF_SUCCESS_STATUS) { + StringBuilder errmsg = new StringBuilder(); + errmsg.append("SSH command returned error status [").append(status).append(']'); + String stderrRes = ctx.getAttribute(PARAM_OUT_stderr); + String stdoutRes = ctx.getAttribute(PARAM_OUT_stdout); + if((stderrRes != null) && !stderrRes.isEmpty()) { + errmsg.append(". Error: [").append(stderrRes).append(']'); + } else if ((stdoutRes != null) && !stdoutRes.isEmpty()) { + errmsg.append(". Error: [").append(stdoutRes).append(']'); + } + throw new SvcLogicException(errmsg.toString()); + } + } + + /** + * Allows Directed Graphs the ability to interact with SSH APIs. + * @param params HashMap of parameters passed by the DG to this function + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * vpn-information.vrf-details + * + * + * + * + * + *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to template file that can be used to build a request/sdncopt/bvc/sshapi/templates/vnf_service-configuration-operation_minimal.json
UrlMandatoryurl to make the SSH connection request to.
PortMandatoryport to make the SSH connection request to.
UserOptionaluser name to use for ssh basic authenticationsdnc_ws
PasswordOptionalunencrypted password to use for ssh basic authenticationplain_password
SshKeyOptionalConsumer SSH key to use for ssh authenticationplain_key
ExecTimeoutOptionalSSH command execution timeoutplain_key
RetryOptionalMake ssh connection with default retry policyplain_key
CmdMandatoryssh command to be executed on the server.get post put delete patch
ResponsePrefixOptionallocation the response will be written to in context memorytmp.sshapi.result
ResponseTypeOptionalIf we know the response is to be in a specific format (supported are JSON, XML and NONE) tmp.sshapi.result
listName[i]OptionalUsed for processing XML responses with repeating elements.
ConvertResponse Optionalwhether the response should be convertedtrue or false
AuthTypeOptionalType of authentiation to be used BASIC or sshKey basedtrue or false
EnvParametersOptionalA JSON dictionary which should list key value pairs to be passed to the command execution. + * These values would correspond to instance specific parameters that a command may need to execute an action.
FileParametersOptionalA JSON dictionary where keys are filenames and values are contents of files. + * The SSH Server will utilize this feature to generate files with keys as filenames and values as content. + * This attribute can be used to generate files that a command may require as part of execution.
+ * Exec remote command over SSH. Return command execution status. + * Command output is written to out or err stream. + * + * @param ctx Reference to context memory */ - void execCommandWithPty(Map paramMap, SvcLogicContext ctx) throws SvcLogicException ; + public void execCommandWithPty(Map params, SvcLogicContext ctx) throws SvcLogicException { + } } diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/AuthType.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/AuthType.java deleted file mode 100644 index 308162271..000000000 --- a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/AuthType.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.onap.ccsdk.sli.plugins.sshapicall.impl; - -public enum AuthType { - NONE, BASIC, DIGEST, OAUTH, Unspecified; - - public static AuthType fromString(String s) { - if ("basic".equalsIgnoreCase(s)) - return BASIC; - if ("digest".equalsIgnoreCase(s)) - return DIGEST; - if ("oauth".equalsIgnoreCase(s)) - return OAUTH; - if ("none".equalsIgnoreCase(s)) - return NONE; - if ("unspecified".equalsIgnoreCase(s)) - return Unspecified; - throw new IllegalArgumentException("Invalid value for format: " + s); - } -} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Format.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Format.java deleted file mode 100644 index 75604de66..000000000 --- a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Format.java +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * * Copyright (C) 2017 AT&T Intellectual Property. - * ================================================================================ - * Copyright (C) 2018 Samsung Electronics. All rights - * reserved. - * ================================================================================ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.ccsdk.sli.plugins.sshapicall.impl; - -public enum Format { - JSON, XML, NONE; - - public static Format fromString(String s) { - if ("json".equalsIgnoreCase(s)) - return JSON; - if ("xml".equalsIgnoreCase(s)) - return XML; - if ("none".equalsIgnoreCase(s)) - return NONE; - throw new IllegalArgumentException("Invalid value for format: " + s); - } -} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Parameters.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Parameters.java deleted file mode 100644 index a392cc73c..000000000 --- a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/Parameters.java +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * * Copyright (C) 2017 AT&T Intellectual Property. - * ================================================================================ - * Copyright (C) 2018 Samsung Electronics. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.ccsdk.sli.plugins.sshapicall.impl; - -import java.util.Set; - -public class Parameters { - public String templateFileName; - public String sshapiUrl; - public String sshapiUser; - public String sshapiPassword; - public Format sshKey; - public String cmd; - public String responsePrefix; - public Set listNameList; - public boolean convertResponse; - public Boolean dumpHeaders; - public String requestBody; - public AuthType authtype; - public Boolean returnRequestPayload; -} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/SshapiCallNodeImpl.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/SshapiCallNodeImpl.java deleted file mode 100644 index 9283b8b5f..000000000 --- a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/impl/SshapiCallNodeImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * * Copyright (C) 2017 AT&T Intellectual Property. - * ================================================================================ - * Copyright (C) 2018 Samsung Electronics. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.ccsdk.sli.plugins.sshapicall.impl; - -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.sshapicall.SshApiCallNode; - -import java.io.OutputStream; -import java.util.Map; - -public class SshapiCallNodeImpl implements SshApiCallNode { - @Override - public void execCommand(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - //TODO: Implementation - } - - @Override - public void execCommandWithPty(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - //TODO: Implementation - } -} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/AuthType.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/AuthType.java new file mode 100644 index 000000000..2ec48c70c --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/AuthType.java @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.model; + +public enum AuthType { + NONE, BASIC, KEY, UNSPECIFIED; + + public static AuthType fromString(String s) { + if ("basic".equalsIgnoreCase(s)) + return BASIC; + if ("key".equalsIgnoreCase(s)) + return KEY; + if ("unspecified".equalsIgnoreCase(s)) + return UNSPECIFIED; + if ("none".equalsIgnoreCase(s)) + return NONE; + throw new IllegalArgumentException("Invalid value for format: " + s); + } +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/Format.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/Format.java new file mode 100644 index 000000000..e50a96c6c --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/Format.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.model; + +public enum Format { + JSON, XML, NONE; + + public static Format fromString(String s) { + if ("json".equalsIgnoreCase(s)) + return JSON; + if ("xml".equalsIgnoreCase(s)) + return XML; + if ("none".equalsIgnoreCase(s)) + return NONE; + throw new IllegalArgumentException("Invalid value for format: " + s); + } +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/JsonParser.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/JsonParser.java index e840053f8..f40f1ad71 100644 --- a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/JsonParser.java +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/JsonParser.java @@ -47,11 +47,10 @@ public final class JsonParser { @SuppressWarnings("unchecked") public static Map convertToProperties(String s) - throws SvcLogicException { + throws JSONException { checkNotNull(s, "Input should not be null."); - try { JSONObject json = new JSONObject(s); Map wm = new HashMap<>(); Iterator ii = json.keys(); @@ -89,8 +88,5 @@ public final class JsonParser { } } return mm; - } catch (JSONException e) { - throw new SvcLogicException("Unable to convert JSON to properties" + e.getLocalizedMessage(), e); - } } } diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/Parameters.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/Parameters.java new file mode 100644 index 000000000..a22da5bcb --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/Parameters.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.model; + +import java.util.Set; + +public class Parameters { + public String sshapiUrl; + public int sshapiPort; + public String sshapiUser; + public String sshapiPassword; + public String sshKey; + public long sshExecTimeout; + public String sshFileParameters; + public String sshEnvParameters; + public boolean sshWithRetry; + public String cmd; + public String responsePrefix; + public Format responseType; + + public Set listNameList; + public boolean convertResponse; + public AuthType authtype; +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/ParseParam.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/ParseParam.java new file mode 100644 index 000000000..caf49ef91 --- /dev/null +++ b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/ParseParam.java @@ -0,0 +1,274 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * * Copyright (C) 2017 AT&T Intellectual Property. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.sshapicall.model; + +import com.google.common.base.Strings; +import org.json.JSONException; +import org.json.JSONObject; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +public class ParseParam { + private static final Logger log = LoggerFactory.getLogger(ParseParam.class); + /** + * Default SSH command timeout + */ + private long dEF_timeout = 12000; + /** + * Default SSH connection port. + */ + private int dEF_port = 22; + /** + * Default SSH command timeout + */ + private final String FILE_PARAMETERS_OPT_KEY = "FileParameters"; + /** + * Default SSH connection port. + */ + private final String ENV_PARAMETERS_OPT_KEY = "EnvParameters"; + private Parameters p = new Parameters(); + + public Parameters getParameters(Map paramMap) throws SvcLogicException { + p.sshapiUrl = parseParam(paramMap, "Url", true, null); + p.sshapiPort = Integer.parseInt(parseParam(paramMap, "Port", true, Integer.toString(dEF_port))); + p.sshapiUser = parseParam(paramMap, "User", false, null); + p.sshapiPassword = parseParam(paramMap, "Password", false, null); + p.sshKey = parseParam(paramMap, "SshKey", false, null); + p.sshExecTimeout = Long.parseLong(parseParam(paramMap, "ExecTimeout", false, Long.toString(dEF_timeout))); + p.sshWithRetry = Boolean.valueOf(parseParam(paramMap, "Retry", false, "false")); + p.cmd = parseParam(paramMap, "Cmd", true, null); + p.responsePrefix = parseParam(paramMap, "ResponsePrefix", false, null); + p.responseType = Format.fromString(parseParam(paramMap, "ResponseType", false, "none")); + p.listNameList = getListNameList(paramMap); + p.convertResponse = Boolean.valueOf(parseParam(paramMap, "ConvertResponse", false, "true")); + p.authtype = AuthType.fromString(parseParam(paramMap, "AuthType", false, "unspecified")); + + return p; + } + + public void parseOutput (SvcLogicContext ctx, String outMessage) throws SvcLogicException { + if (p.convertResponse) { + if (p.responseType == Format.NONE) { + classifyOutput(ctx, outMessage); + } else if (p.responseType == Format.JSON) { + classifyOutput(ctx, outMessage); + } else if (p.responseType == Format.XML) { + classifyOutput(ctx, outMessage, p.listNameList); + } + } + } + + private void classifyOutput(SvcLogicContext ctx, String outMessage, Set listNameList) throws SvcLogicException { + Map mm = XmlParser.convertToProperties(outMessage, p.listNameList); + toCtx (ctx, mm); + } + + private void toCtx (SvcLogicContext ctx, Map mm) { + if (mm != null) { + for (Map.Entry entry : mm.entrySet()) { + if (p.responsePrefix != null) { + ctx.setAttribute(p.responsePrefix + "." + entry.getKey(), entry.getValue()); + log.info("+++ " + p.responsePrefix + "." + entry.getKey() + ": [" + entry.getValue() + "]"); + } else { + ctx.setAttribute(entry.getKey(), entry.getValue()); + log.info("+++ " + entry.getKey() + ": [" + entry.getValue() + "]"); + } + } + } + } + + private void classifyOutput(SvcLogicContext ctx, String outMessage) throws SvcLogicException { + try { + Map mm = JsonParser.convertToProperties(outMessage); + toCtx (ctx, mm); + } catch (org.codehaus.jettison.json.JSONException e) { + log.info("Output not in JSON format"); + putToProperties(ctx, p.responsePrefix); + } catch (Exception e) { + throw new SvcLogicException("error parsing response file"); + } + } + + private void putToProperties(SvcLogicContext ctx, String outMessage) throws SvcLogicException { + + try { + Properties prop = new Properties(); + prop.load(new ByteArrayInputStream(outMessage.getBytes(StandardCharsets.UTF_8))); + for (Object key : prop.keySet()) { + String name = (String) key; + String value = prop.getProperty(name); + if (value != null && value.trim().length() > 0) { + if (p.responsePrefix != null) { + ctx.setAttribute(p.responsePrefix + "." + name, value.trim()); + log.info("+++ " + p.responsePrefix + "." + name + ": [" + value + "]"); + } else { + ctx.setAttribute(name, value.trim()); + log.info("+++ " + name + ": [" + value + "]"); + } + } + } + } catch (Exception e) { + throw new SvcLogicException( "Error parsing response file."); + } + } + + public String makeCommand (Map params) { + JSONObject jsonPayload = new JSONObject(); + final String[] optionalTestParams = {ENV_PARAMETERS_OPT_KEY, FILE_PARAMETERS_OPT_KEY}; + parseParam(params, optionalTestParams, jsonPayload); + JSONObject envParams = (JSONObject) jsonPayload.remove(ENV_PARAMETERS_OPT_KEY); + JSONObject fileParams = (JSONObject) jsonPayload.remove(FILE_PARAMETERS_OPT_KEY); + + StringBuilder constructedCommand = new StringBuilder(); + constructedCommand.append(parseFileParam(fileParams)).append(p.cmd).append(" ").append(parseEnvParam(envParams)); + + return constructedCommand.toString(); + } + + private String parseEnvParam(JSONObject envParams) { + StringBuilder envParamBuilder = new StringBuilder(); + if (envParams != null) { + for (Object key : envParams.keySet()) { + if (envParamBuilder.length() > 0) { + envParamBuilder.append(", "); + } + envParamBuilder.append(key + "=" + envParams.get((String) key)); + } + } + return envParamBuilder.toString(); + } + + private String parseFileParam(JSONObject fileParams) { + StringBuilder fileParamBuilder = new StringBuilder(); + if (fileParams != null) { + for (Object key : fileParams.keySet()) { + fileParamBuilder.append("echo -e \"" + fileParams.get((String) key) + "\" > /srv/salt/" + key).append("; "); + } + } + return fileParamBuilder.toString(); + } + + private void parseParam(Map params, String[] optionalTestParams, JSONObject jsonPayload) + throws JSONException { + + Set optionalParamsSet = new HashSet<>(); + Collections.addAll(optionalParamsSet, optionalTestParams); + + //@formatter:off + params.entrySet() + .stream() + .filter(entry -> optionalParamsSet.contains(entry.getKey())) + .filter(entry -> !Strings.isNullOrEmpty(entry.getValue())) + .forEach(entry -> parseParam(entry, jsonPayload)); + //@formatter:on + } + + private void parseParam(Map.Entry params, JSONObject jsonPayload) + throws JSONException { + String key = params.getKey(); + String payload = params.getValue(); + + switch (key) { + case ENV_PARAMETERS_OPT_KEY: + JSONObject paramsJson = new JSONObject(payload); + jsonPayload.put(key, paramsJson); + break; + + case FILE_PARAMETERS_OPT_KEY: + jsonPayload.put(key, getFilePayload(payload)); + break; + + default: + break; + } + } + + /** + * Return payload with escaped newlines + */ + private JSONObject getFilePayload(String payload) { + String formattedPayload = payload.replace("\n", "\\n").replace("\r", "\\r"); + return new JSONObject(formattedPayload); + } + + private Set getListNameList(Map paramMap) { + Set ll = new HashSet<>(); + for (Map.Entry entry : paramMap.entrySet()) + if (entry.getKey().startsWith("listName")) + ll.add(entry.getValue()); + return ll; + } + + private String parseParam(Map paramMap, String name, boolean required, String def) + throws SvcLogicException { + String s = paramMap.get(name); + + if (s == null || s.trim().length() == 0) { + if (!required) + return def; + throw new SvcLogicException("Parameter " + name + " is required in sshapiCallNode"); + } + + s = s.trim(); + StringBuilder value = new StringBuilder(); + int i = 0; + int i1 = s.indexOf('%'); + while (i1 >= 0) { + int i2 = s.indexOf('%', i1 + 1); + if (i2 < 0) + break; + + String varName = s.substring(i1 + 1, i2); + String varValue = System.getenv(varName); + if (varValue == null) + varValue = "%" + varName + "%"; + + value.append(s.substring(i, i1)); + value.append(varValue); + + i = i2 + 1; + i1 = s.indexOf('%', i); + } + value.append(s.substring(i)); + + log.info("Parameter {}: [{}]", name, value); + return value.toString(); + } +} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryException.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryException.java deleted file mode 100644 index 9a1d3a312..000000000 --- a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryException.java +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * * Copyright (C) 2017 AT&T Intellectual Property. - * ================================================================================ - * Copyright (C) 2018 Samsung Electronics. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.ccsdk.sli.plugins.sshapicall.model; - -public class RetryException extends Exception { - - public RetryException(String message) { - super(message); - } - -} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicy.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicy.java deleted file mode 100644 index fef0f81af..000000000 --- a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicy.java +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * * Copyright (C) 2017 AT&T Intellectual Property. - * ================================================================================ - * Copyright (C) 2018 Samsung Electronics. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.ccsdk.sli.plugins.sshapicall.model; - -public class RetryPolicy { - private String[] hostnames; - private Integer maximumRetries; - - public Integer getMaximumRetries() { - return maximumRetries; - } - - public String getNextHostName(String uri) throws RetryException { - Integer position = null; - - for (int i = 0; i < hostnames.length; i++) { - if (uri.contains(hostnames[i])) { - position = i; - break; - } - } - - if(position == null){ - throw new RetryException("No match found for the provided uri[" + uri + "] " + - "so the next host name could not be retreived"); - } - position++; - - if (position > hostnames.length - 1) { - position = 0; - } - return hostnames[position]; - } - - public RetryPolicy(String[] hostnames, Integer maximumRetries){ - this.hostnames = hostnames; - this.maximumRetries = maximumRetries; - } - - -} diff --git a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicyStore.java b/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicyStore.java deleted file mode 100644 index 65575b8ce..000000000 --- a/sshapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/sshapicall/model/RetryPolicyStore.java +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * * Copyright (C) 2017 AT&T Intellectual Property. - * ================================================================================ - * Copyright (C) 2018 Samsung Electronics. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.ccsdk.sli.plugins.sshapicall.model; - -import java.util.HashMap; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RetryPolicyStore { - private static final Logger log = LoggerFactory.getLogger(RetryPolicyStore.class); - - HashMap retryPolicies; - public String proxyServers; - - public String getProxyServers() { - return proxyServers; - } - - public void setProxyServers(String admServers) { - this.proxyServers = admServers; - String[] adminServersArray = admServers.split(","); - RetryPolicy adminPortalRetry = new RetryPolicy(adminServersArray, adminServersArray.length); - retryPolicies.put("dme2proxy", adminPortalRetry); - } - - public RetryPolicyStore() { - retryPolicies = new HashMap<>(); - } - - public RetryPolicy getRetryPolicy(String policyName) { - return (this.retryPolicies.get(policyName)); - } - -} diff --git a/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-context.xml b/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-context.xml index 4cce6ffad..50c9b2aa3 100644 --- a/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-context.xml +++ b/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-context.xml @@ -40,12 +40,8 @@ - + - - - - diff --git a/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-osgi-context.xml b/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-osgi-context.xml index c8e9a99e3..25631d6af 100644 --- a/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-osgi-context.xml +++ b/sshapi-call-node/provider/src/main/resources/META-INF/spring/sshapi-call-node-osgi-context.xml @@ -29,6 +29,6 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/sshapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/sshapi-call-node-blueprint.xml b/sshapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/sshapi-call-node-blueprint.xml index b24aaf1ee..7a5424329 100755 --- a/sshapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/sshapi-call-node-blueprint.xml +++ b/sshapi-call-node/provider/src/main/resources/org/opendaylight/blueprint/sshapi-call-node-blueprint.xml @@ -3,7 +3,7 @@ xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0" odl:use-default-for-reference-types="true"> - + diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java index 9df790ae3..66be73001 100644 --- a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java +++ b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java @@ -31,6 +31,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import org.codehaus.jettison.json.JSONException; import org.junit.Test; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.plugins.sshapicall.model.JsonParser; @@ -50,8 +51,12 @@ public class TestJsonParser { String line; while ((line = in.readLine()) != null) b.append(line).append('\n'); - - Map mm = JsonParser.convertToProperties(b.toString()); + Map mm = null; + try { + mm = JsonParser.convertToProperties(b.toString()); + } catch (JSONException e){ + throw new SvcLogicException(e.getMessage()); + } logProperties(mm); @@ -60,7 +65,12 @@ public class TestJsonParser { @Test(expected = NullPointerException.class) public void testNullString() throws SvcLogicException { - JsonParser.convertToProperties(null); + Map mm = null; + try { + mm = JsonParser.convertToProperties(null); + } catch (JSONException e){ + throw new SvcLogicException(e.getMessage()); + } } private void logProperties(Map mm) { -- cgit 1.2.3-korg From f4817b420b59de111a0abe1eec761bd3e4458530 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Tue, 14 Aug 2018 14:43:31 +0000 Subject: dme2 & ueb support fix dme2 & ueb support in rest api call node Change-Id: Ia387c0be8e907900e0b808879582048624dbef36 Issue-ID: CCSDK-459 Signed-off-by: Smokowski, Kevin (ks6305) --- restapi-call-node/provider/pom.xml | 14 ------- .../sli/plugins/restapicall/RestapiCallNode.java | 24 +++++++++++ .../META-INF/spring/restapi-call-node-context.xml | 49 ---------------------- .../spring/restapi-call-node-osgi-context.xml | 32 -------------- 4 files changed, 24 insertions(+), 95 deletions(-) delete mode 100644 restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml delete mode 100644 restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 18a20cef1..6670cfd8c 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -14,7 +14,6 @@ bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - http://maven.apache.org UTF-8 @@ -26,11 +25,6 @@ junit test - - org.springframework - spring-test - test - org.onap.ccsdk.sli.core sli-common @@ -43,14 +37,6 @@ org.slf4j slf4j-api - - org.springframework - spring-beans - - - org.springframework - spring-context - com.sun.jersey jersey-client diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 42462f0e6..46c74ff8a 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -37,6 +37,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Properties; import java.util.Set; import javax.net.ssl.HostnameVerifier; @@ -75,6 +76,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { private String uebServers; private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; protected RetryPolicyStore retryPolicyStore; + protected static final String DME2_PROPERTIES_FILE_NAME = "dme2.properties"; + protected static final String UEB_PROPERTIES_FILE_NAME = "ueb.properties"; + protected static final String DEFAULT_PROPERTIES_DIR = "/opt/onap/ccsdk/data/properties"; + protected static final String PROPERTIES_DIR_KEY = "SDNC_CONFIG_DIR"; protected RetryPolicyStore getRetryPolicyStore() { return retryPolicyStore; @@ -85,7 +90,26 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } public RestapiCallNode() { + String configDir = System.getProperty(PROPERTIES_DIR_KEY, DEFAULT_PROPERTIES_DIR); + + try (FileInputStream in = new FileInputStream(configDir + "/" + DME2_PROPERTIES_FILE_NAME)) { + Properties props = new Properties(); + props.load(in); + this.retryPolicyStore = new RetryPolicyStore(); + this.retryPolicyStore.setProxyServers(props.getProperty("proxyUrl")); + log.info("DME2 support enabled"); + } catch (Exception e) { + log.warn("DME2 properties could not be read, DME2 support will not be enabled.", e); + } + try (FileInputStream in = new FileInputStream(configDir + "/" + UEB_PROPERTIES_FILE_NAME)) { + Properties props = new Properties(); + props.load(in); + this.uebServers = props.getProperty("servers"); + log.info("UEB support enabled"); + } catch (Exception e) { + log.warn("UEB properties could not be read, UEB support will not be enabled.", e); + } } /** diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml deleted file mode 100644 index 87850624c..000000000 --- a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - file:${SDNC_CONFIG_DIR}/ueb.properties - file:${SDNC_CONFIG_DIR}/dme2.properties - - - - - - - - - - - - - - - - - diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml deleted file mode 100644 index 2f1e4dbde..000000000 --- a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - -- cgit 1.2.3-korg From c8a20b7cdc2b563e1ea86a9e25f4ac0e748995f9 Mon Sep 17 00:00:00 2001 From: janani b Date: Wed, 29 Aug 2018 11:52:41 +0530 Subject: Implementation for Restconf api call node Restconf Api Call Node Issue-ID: CCSDK-372 Change-Id: I1820e97d54e734ccf73c6f48a9afcc4b59dff549 Signed-off-by: janani b --- .../sli/plugins/restapicall/RestapiCallNode.java | 171 ++++++---- restconf-client/provider/pom.xml | 17 +- .../restconfapicall/RestconfApiCallNode.java | 362 +++++++++++++++++++++ .../plugins/restconfapicall/RestconfApiUtils.java | 213 ++++++++++++ .../restconfapicall/RestconfapiCallNode.java | 65 ---- .../restconfdiscovery/RestconfDiscoveryNode.java | 14 +- .../dfserializer/MdsalSerializerHelper.java | 4 +- .../META-INF/spring/restconf-client-context.xml | 4 +- .../spring/restconf-client-osgi-context.xml | 2 +- .../blueprint/restconf-client-blueprint.xml | 4 +- 10 files changed, 720 insertions(+), 136 deletions(-) create mode 100644 restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java create mode 100644 restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java delete mode 100644 restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfapiCallNode.java (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 46c74ff8a..6a9e81bcc 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -21,8 +21,33 @@ package org.onap.ccsdk.sli.plugins.restapicall; +import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientHandlerException; +import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.UniformInterfaceException; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; +import com.sun.jersey.api.client.filter.HTTPDigestAuthFilter; +import com.sun.jersey.client.urlconnection.HTTPSProperties; +import com.sun.jersey.oauth.client.OAuthClientFilter; +import com.sun.jersey.oauth.signature.OAuthParameters; +import com.sun.jersey.oauth.signature.OAuthSecrets; +import org.apache.commons.lang3.StringUtils; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.ws.rs.core.EntityTag; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.UriBuilder; import java.io.FileInputStream; import java.io.IOException; import java.net.SocketException; @@ -40,34 +65,8 @@ import java.util.Map.Entry; import java.util.Properties; import java.util.Set; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; -import javax.ws.rs.core.EntityTag; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.UriBuilder; - -import org.apache.commons.lang3.StringUtils; -import org.codehaus.jettison.json.JSONException; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.WebResource; -import com.sun.jersey.api.client.config.ClientConfig; -import com.sun.jersey.api.client.config.DefaultClientConfig; -import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; -import com.sun.jersey.api.client.filter.HTTPDigestAuthFilter; -import com.sun.jersey.oauth.client.OAuthClientFilter; -import com.sun.jersey.oauth.signature.OAuthParameters; -import com.sun.jersey.oauth.signature.OAuthSecrets; -import com.sun.jersey.client.urlconnection.HTTPSProperties; +import static java.lang.Boolean.valueOf; +import static org.onap.ccsdk.sli.plugins.restapicall.AuthType.fromString; public class RestapiCallNode implements SvcLogicJavaPlugin { @@ -81,7 +80,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { protected static final String DEFAULT_PROPERTIES_DIR = "/opt/onap/ccsdk/data/properties"; protected static final String PROPERTIES_DIR_KEY = "SDNC_CONFIG_DIR"; - protected RetryPolicyStore getRetryPolicyStore() { + public RetryPolicyStore getRetryPolicyStore() { return retryPolicyStore; } @@ -154,7 +153,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { RetryPolicy retryPolicy = null; HttpResponse r = new HttpResponse(); try { - Parameters p = getParameters(paramMap); + Parameters p = getParameters(paramMap, new Parameters()); if (p.partner != null) { retryPolicy = retryPolicyStore.getRetryPolicy(p.partner); } @@ -245,49 +244,88 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); } - protected Parameters getParameters(Map paramMap) throws SvcLogicException { - Parameters p = new Parameters(); - p.templateFileName = parseParam(paramMap, "templateFileName", false, null); + /** + * Returns parameters from the parameter map. + * + * @param paramMap parameter map + * @param p parameters instance + * @return parameters filed instance + * @throws SvcLogicException when svc logic exception occurs + */ + public static Parameters getParameters(Map paramMap, + Parameters p) + throws SvcLogicException { + p.templateFileName = parseParam(paramMap, "templateFileName", + false, null); p.requestBody = parseParam(paramMap, "requestBody", false, null); p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); validateUrl(p.restapiUrl); p.restapiUser = parseParam(paramMap, "restapiUser", false, null); - p.restapiPassword = parseParam(paramMap, "restapiPassword", false, null); - p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", false, null); - p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", false, null); - p.oAuthSignatureMethod = parseParam(paramMap, "oAuthSignatureMethod", false, null); + p.restapiPassword = parseParam(paramMap, "restapiPassword", false, + null); + p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", + false, null); + p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", + false, null); + p.oAuthSignatureMethod = parseParam(paramMap, "oAuthSignatureMethod", + false, null); p.oAuthVersion = parseParam(paramMap, "oAuthVersion", false, null); p.contentType = parseParam(paramMap, "contentType", false, null); - p.format = Format.fromString(parseParam(paramMap, "format", false, "json")); - p.authtype = AuthType.fromString(parseParam(paramMap, "authType", false, "unspecified")); - p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); + p.format = Format.fromString(parseParam(paramMap, "format", false, + "json")); + p.authtype = fromString(parseParam(paramMap, "authType", false, + "unspecified")); + p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", + false, "post")); p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); p.listNameList = getListNameList(paramMap); String skipSendingStr = paramMap.get("skipSending"); p.skipSending = "true".equalsIgnoreCase(skipSendingStr); - p.convertResponse = Boolean.valueOf(parseParam(paramMap, "convertResponse", false, "true")); - p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", false, null); - p.trustStorePassword = parseParam(paramMap, "trustStorePassword", false, null); - p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", false, null); - p.keyStorePassword = parseParam(paramMap, "keyStorePassword", false, null); - p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null && p.keyStoreFileName != null && - p.keyStorePassword != null; - p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null); + p.convertResponse = valueOf(parseParam(paramMap, "convertResponse", + false, "true")); + p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", + false, null); + p.trustStorePassword = parseParam(paramMap, "trustStorePassword", + false, null); + p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", + false, null); + p.keyStorePassword = parseParam(paramMap, "keyStorePassword", + false, null); + p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null + && p.keyStoreFileName != null && p.keyStorePassword != null; + p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", + false, null); p.partner = parseParam(paramMap, "partner", false, null); - p.dumpHeaders = Boolean.valueOf(parseParam(paramMap, "dumpHeaders", false, null)); - p.returnRequestPayload = Boolean.valueOf(parseParam(paramMap, "returnRequestPayload", false, null)); + p.dumpHeaders = valueOf(parseParam(paramMap, "dumpHeaders", + false, null)); + p.returnRequestPayload = valueOf(parseParam( + paramMap, "returnRequestPayload", false, null)); return p; } - private void validateUrl(String restapiUrl) throws SvcLogicException { + /** + * Validates the given URL in the parameters. + * + * @param restapiUrl rest api URL + * @throws SvcLogicException when URL validation fails + */ + private static void validateUrl(String restapiUrl) + throws SvcLogicException { try { URI.create(restapiUrl); } catch (IllegalArgumentException e) { - throw new SvcLogicException("Invalid input of url " + e.getLocalizedMessage(), e); + throw new SvcLogicException("Invalid input of url " + + e.getLocalizedMessage(), e); } } - protected Set getListNameList(Map paramMap) { + /** + * Returns the list of list name. + * + * @param paramMap parameters map + * @return list of list name + */ + private static Set getListNameList(Map paramMap) { Set ll = new HashSet<>(); for (Map.Entry entry : paramMap.entrySet()) if (entry.getKey().startsWith("listName")) @@ -295,7 +333,19 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return ll; } - protected String parseParam(Map paramMap, String name, boolean required, String def) + /** + * Parses the parameter string map of property, validates if required, + * assigns default value if present and returns the value. + * + * @param paramMap string param map + * @param name name of the property + * @param required if value required + * @param def default value + * @return value of the property + * @throws SvcLogicException if required parameter value is empty + */ + public static String parseParam(Map paramMap, String name, + boolean required, String def) throws SvcLogicException { String s = paramMap.get(name); @@ -524,7 +574,16 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return client; } - protected HttpResponse sendHttpRequest(String request, Parameters p) throws SvcLogicException { + /** + * Receives the http response for the http request sent. + * + * @param request request msg + * @param p parameters + * @return HTTP response + * @throws SvcLogicException when sending http request fails + */ + public HttpResponse sendHttpRequest(String request, Parameters p) + throws SvcLogicException { ClientConfig config = new DefaultClientConfig(); SSLContext ssl = null; @@ -693,7 +752,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.oAuthVersion = parseParam(paramMap, "oAuthVersion", false, null); p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", false, null); p.oAuthSignatureMethod = parseParam(paramMap, "oAuthSignatureMethod", false, null); - p.authtype = AuthType.fromString(parseParam(paramMap, "authType", false, "unspecified")); + p.authtype = fromString(parseParam(paramMap, "authType", false, "unspecified")); return p; } diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 4183d48be..099412642 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -114,8 +114,23 @@ org.opendaylight.netconf restconf-nb-rfc8040 - 1.7.4-SNAPSHOT + 1.7.3 test + + org.opendaylight.yangtools + yang-parser-impl + 2.0.6.1 + + + org.opendaylight.netconf + restconf-common + 1.7.3 + + + org.opendaylight.netconf + restconf-nb-bierman02 + 1.7.3 + diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java new file mode 100644 index 000000000..c5f73305b --- /dev/null +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java @@ -0,0 +1,362 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - CCSDK + * ================================================================================ + * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restconfapicall; + +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.onap.ccsdk.sli.plugins.restapicall.HttpResponse; +import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; +import org.onap.ccsdk.sli.plugins.restapicall.RetryException; +import org.onap.ccsdk.sli.plugins.restapicall.RetryPolicy; +import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DataFormatSerializer; +import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DataFormatSerializerContext; +import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerFactory; +import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.Listener; +import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.MdsalSerializerHelper; +import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.SerializerHelper; +import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.YangParameters; +import org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeSerializer; +import org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.PropertiesNodeSerializer; +import org.opendaylight.netconf.sal.restconf.impl.ControllerContext; +import org.opendaylight.restconf.common.context.InstanceIdentifierContext; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.ws.rs.core.UriBuilder; +import java.net.SocketException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static java.lang.String.format; +import static org.apache.commons.lang3.StringUtils.join; +import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.POST; +import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.PUT; +import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.ATTEMPTS_MSG; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COMMA; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COMM_FAIL; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HEADER; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HTTP_REQ; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HTTP_RES; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.MAX_RETRY_ERR; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.NO_MORE_RETRY; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.REQ_ERR; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.REST_API_URL; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_CODE; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_MSG; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_PRE; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RETRY_COUNT; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RETRY_FAIL; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.UPDATED_URL; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getSchemaCtxFromDir; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getYangParameters; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.parseUrl; +import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfListenerFactory.instance; +import static org.osgi.framework.FrameworkUtil.getBundle; + +/** + * Representation of a plugin to enable RESTCONF based CRUD operations from DG. + */ +public class RestconfApiCallNode implements SvcLogicJavaPlugin { + + /** + * Logger for the restconf api call node class. + */ + private static final Logger log = LoggerFactory.getLogger( + RestconfApiCallNode.class); + + /** + * Creates an instance of restconf api call node. + */ + public RestconfApiCallNode() { + } + + /** + * Sends the restconf request using the parameters map and the memory + * context. And this method allows the directed graphs to interact with + * the restconf api call node + * + * @param paramMap parameters map + * @param ctx service logic context + * @throws SvcLogicException when svc logic exception occurs + */ + public void sendRequest(Map paramMap, SvcLogicContext ctx) + throws SvcLogicException { + sendRequest(paramMap, ctx, 0); + } + + /** + * Sends the restconf request using the parameters map and the memory + * context along with the retry count. + * + * @param paramMap parameters map + * @param ctx service logic context + * @param retryCount number of retry counts + * @throws SvcLogicException when svc logic exception occurs + */ + public void sendRequest(Map paramMap, SvcLogicContext ctx, + Integer retryCount) throws SvcLogicException { + RestapiCallNode rest = new RestapiCallNode(); + RetryPolicy retryPolicy = null; + HttpResponse r = new HttpResponse(); + try { + YangParameters p = getYangParameters(paramMap); + if (p.partner != null) { + retryPolicy = rest.getRetryPolicyStore() + .getRetryPolicy(p.partner); + } + + String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; + Map props = new HashMap<>((Map)ctx.toProperties()); + String uri = parseUrl(p.restapiUrl, p.httpMethod); + InstanceIdentifierContext insIdCtx = getInsIdCtx(p, uri); + + String req = null; + if (p.httpMethod == POST || p.httpMethod == PUT) { + req = serializeRequest(props, p, uri, insIdCtx); + } + if (req == null && p.requestBody != null) { + req = p.requestBody; + } + + r = rest.sendHttpRequest(req, p); + if (p.returnRequestPayload && req != null) { + ctx.setAttribute(pp + HTTP_REQ, req); + } + + String response = getResponse(ctx, p, pp, r); + if (response != null) { + Map resProp = serializeResponse( + p, uri, response, insIdCtx); + for (Map.Entry pro : resProp.entrySet()) { + ctx.setAttribute(pro.getKey(), pro.getValue()); + } + } + } catch (SvcLogicException e) { + boolean shouldRetry = false; + if (e.getCause().getCause() instanceof SocketException) { + shouldRetry = true; + } + + log.error(REQ_ERR + e.getMessage(), e); + String prefix = parseParam(paramMap, RES_PRE, false, null); + if (retryPolicy == null || shouldRetry == false) { + setFailureResponseStatus(ctx, prefix, e.getMessage(), r); + } else { + if (retryCount == null) { + retryCount = 0; + } + log.debug(format(ATTEMPTS_MSG, retryCount, + retryPolicy.getMaximumRetries())); + try { + retryCount = retryCount + 1; + if (retryCount < retryPolicy.getMaximumRetries() + 1) { + setRetryUri(paramMap, retryPolicy); + log.debug(format(RETRY_COUNT, retryCount, retryPolicy + .getMaximumRetries())); + sendRequest(paramMap, ctx, retryCount); + } else { + log.debug(MAX_RETRY_ERR); + setFailureResponseStatus(ctx, prefix, + e.getMessage(), r); + } + } catch (Exception ex) { + log.error(NO_MORE_RETRY, ex); + setFailureResponseStatus(ctx, prefix, RETRY_FAIL, r); + } + } + } + + if (r != null && r.code >= 300) { + throw new SvcLogicException( + String.valueOf(r.code) + ": " + r.message); + } + } + + /** + * Serializes the request message to JSON or XML from the properties. + * + * @param properties properties + * @param params YANG parameters + * @param uri URI + * @param insIdCtx instance identifier context + * @return JSON or XML message to be sent + * @throws SvcLogicException when serializing the request fails + */ + protected String serializeRequest(Map properties, + YangParameters params, String uri, + InstanceIdentifierContext insIdCtx) + throws SvcLogicException { + PropertiesNodeSerializer propSer = new MdsalPropertiesNodeSerializer( + insIdCtx.getSchemaNode(), insIdCtx.getSchemaContext(), uri); + DataFormatSerializerContext serCtx = new DataFormatSerializerContext( + null, uri, null, propSer); + DataFormatSerializer ser = DfSerializerFactory.instance() + .getSerializer(serCtx, params); + //TODO: Handling of XML annotations + return ser.encode(properties, null); + } + + /** + * Serializes the response message from JSON or XML to the properties. + * + * @param params YANG parameters + * @param uri URI + * @param response response message + * @param insIdCtx instance identifier context + * @return response message as properties + * @throws SvcLogicException when serializing the response fails + */ + protected Map serializeResponse(YangParameters params, + String uri, String response, + InstanceIdentifierContext insIdCtx) + throws SvcLogicException { + PropertiesNodeSerializer propSer = new MdsalPropertiesNodeSerializer( + insIdCtx.getSchemaNode(), insIdCtx.getSchemaContext(), uri); + SerializerHelper helper = new MdsalSerializerHelper( + insIdCtx.getSchemaNode(), insIdCtx.getSchemaContext(), uri); + Listener listener = instance().getListener(helper, params); + DataFormatSerializerContext serCtx = new DataFormatSerializerContext( + listener, uri, null, propSer); + DataFormatSerializer ser = DfSerializerFactory.instance() + .getSerializer(serCtx, params); + return ser.decode(response); + } + + /** + * Returns instance identifier context for a uri using the schema context. + * + * @param params YANG parameters + * @param uri URI + * @return instance identifier context + * @throws SvcLogicException when getting schema context fails + */ + private InstanceIdentifierContext getInsIdCtx(YangParameters params, + String uri) + throws SvcLogicException { + SchemaContext context = getSchemaContext(params); + ControllerContext contCtx = ControllerContext.getInstance(); + contCtx.onGlobalContextUpdated(context); + return contCtx.toInstanceIdentifier(uri); + } + + /** + * Returns the global schema context or schema context of particular YANG + * files present in a directory path. + * + * @param params YANG parameters + * @return schema context + * @throws SvcLogicException when schema context fetching fails + */ + private SchemaContext getSchemaContext(YangParameters params) + throws SvcLogicException { + if (params.dirPath != null) { + return getSchemaCtxFromDir(params.dirPath); + } + BundleContext bc = getBundle(SchemaContext.class).getBundleContext(); + SchemaContext schemaContext = null; + if (bc != null) { + ServiceReference reference = bc.getServiceReference( + SchemaContext.class); + if (reference != null) { + schemaContext = (SchemaContext) bc.getService(reference); + } + } + return schemaContext; + } + + /** + * Returns the response message body of a http response message. + * + * @param ctx svc logic context + * @param params parameters + * @param pre prefix to be appended + * @param res http response + * @return response message body + */ + private String getResponse(SvcLogicContext ctx, YangParameters params, + String pre, HttpResponse res) { + ctx.setAttribute(pre + RES_CODE, String.valueOf(res.code)); + ctx.setAttribute(pre + RES_MSG, res.message); + + if (params.dumpHeaders && res.headers != null) { + for (Map.Entry> a : res.headers.entrySet()) { + ctx.setAttribute(pre + HEADER + a.getKey(), + join(a.getValue(), COMMA)); + } + } + + if (res.body != null && res.body.trim().length() > 0) { + ctx.setAttribute(pre + HTTP_RES, res.body); + return res.body; + } + return null; + } + + /** + * Sets the failure response status in the context memory. + * + * @param ctx service logic context + * @param prefix prefix to be added + * @param errMsg error message + * @param res http response + */ + private void setFailureResponseStatus(SvcLogicContext ctx, String prefix, + String errMsg, HttpResponse res) { + res = new HttpResponse(); + res.code = 500; + res.message = errMsg; + ctx.setAttribute(prefix + RES_CODE, String.valueOf(res.code)); + ctx.setAttribute(prefix + RES_MSG, res.message); + } + + /** + * Sets the retry URI to the param map from the retry policies different + * host. + * + * @param paramMap parameter map + * @param retryPolicy retry policy + * @throws URISyntaxException when new URI creation fails + * @throws RetryException when retry policy cannot give another host + */ + private void setRetryUri(Map paramMap, + RetryPolicy retryPolicy) + throws URISyntaxException, RetryException { + URI uri = new URI(paramMap.get(REST_API_URL)); + String hostName = uri.getHost(); + String retryString = retryPolicy.getNextHostName(uri.toString()); + + URI uriTwo = new URI(retryString); + URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port( + uriTwo.getPort()).scheme(uriTwo.getScheme()).build(); + + paramMap.put(REST_API_URL, retryUri.toString()); + log.debug(UPDATED_URL + retryUri.toString()); + log.debug(format(COMM_FAIL, hostName, retryString)); + } +} diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java new file mode 100644 index 000000000..e066671b1 --- /dev/null +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java @@ -0,0 +1,213 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - CCSDK + * ================================================================================ + * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restconfapicall; + +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.HttpMethod; +import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.YangParameters; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; +import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException; +import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource; +import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException; +import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.PUT; +import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.getParameters; +import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam; +import static org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode.DEFAULT_MODE; +import static org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource.forFile; +import static org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors.defaultReactor; +import static org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.create; + +/** + * Utilities for restconf api call node. + */ +public final class RestconfApiUtils { + + static final String RES_CODE = "response-code"; + + static final String HTTP_REQ ="httpRequest"; + + static final String RES_PRE = "responsePrefix"; + + static final String RES_MSG = "response-message"; + + static final String HEADER = "header."; + + static final String COMMA = ","; + + static final String HTTP_RES = "httpResponse"; + + static final String REST_API_URL = "restapiUrl"; + + static final String UPDATED_URL = "URL was set to"; + + static final String COMM_FAIL = "Failed to communicate with host %s." + + "Request will be re-attempted using the host %s."; + + static final String RETRY_COUNT = "This is retry attempt %d out of %d"; + + static final String RETRY_FAIL = "Retry attempt has failed. No further " + + "retry shall be attempted, calling setFailureResponseStatus"; + + static final String NO_MORE_RETRY = "Could not attempt retry"; + + static final String MAX_RETRY_ERR = "Maximum retries reached, calling " + + "setFailureResponseStatus"; + + static final String ATTEMPTS_MSG = "%d attempts were made out of %d " + + "maximum retries"; + + static final String REQ_ERR = "Error sending the request: "; + + private static final String SLASH = "/"; + + private static final String DIR_PATH = "dirPath"; + + private static final String URL_SYNTAX = "The following URL cannot be " + + "parsed into URI : "; + + private static final String RESTCONF_PATH = "/restconf/operations/"; + + private static final String PUT_NODE_ERR = "The following URL does not " + + "contain minimum two nodes for PUT operation."; + + private static final String YANG = ".yang"; + + private static final String YANG_FILE_ERR = "Unable to parse the YANG " + + "file provided"; + + //No instantiation. + private RestconfApiUtils() { + } + + /** + * Returns the YANG parameters after parsing it from the map. + * + * @param paramMap parameters map + * @return YANG parameters + * @throws SvcLogicException when parsing of parameters map fail + */ + static YangParameters getYangParameters(Map paramMap) + throws SvcLogicException { + YangParameters param = (YangParameters) getParameters( + paramMap, new YangParameters()); + param.dirPath = parseParam(paramMap, DIR_PATH, false, null); + return param; + } + + /** + * Parses the restconf URL and gives the YANG path from it, which can be + * used to get schema node. If it is a PUT operation, then a node must be + * reduced from the url to make it always point to the parent. + * + * @param url restconf URL + * @param method HTTP operation + * @return YANG path pointing to parent + * @throws SvcLogicException when parsing the URL fails + */ + static String parseUrl(String url, HttpMethod method) + throws SvcLogicException { + URI uri; + try { + uri = new URI(url); + } catch (URISyntaxException e) { + throw new SvcLogicException(URL_SYNTAX + url, e); + } + + String path = uri.getPath(); + if (path.contains(RESTCONF_PATH)) { + path = path.replaceFirst(RESTCONF_PATH, ""); + } + if (method == PUT) { + if (!path.contains(SLASH)) { + throw new SvcLogicException(PUT_NODE_ERR + url); + } + path = path.substring(0, path.lastIndexOf(SLASH)); + } + return path; + } + + /** + * Returns the schema context of the YANG files present in a directory. + * + * @param di directory path + * @return YANG schema context + * @throws SvcLogicException when YANG file reading fails + */ + static SchemaContext getSchemaCtxFromDir(String di) + throws SvcLogicException { + Path d = Paths.get(di); + File dir = d.toFile(); + List yangFiles = new LinkedList<>(); + getYangFiles(dir, yangFiles); + final Collection sources = + new ArrayList<>(yangFiles.size()); + for (File file : yangFiles) { + try { + sources.add(create(forFile(file))); + } catch (IOException | YangSyntaxErrorException e) { + throw new SvcLogicException(YANG_FILE_ERR + e.getMessage(), e); + } + } + + final CrossSourceStatementReactor.BuildAction reactor = defaultReactor() + .newBuild(DEFAULT_MODE).addSources(sources); + try { + return reactor.buildEffective(); + } catch (ReactorException e) { + throw new SvcLogicException(YANG_FILE_ERR + e.getMessage(), e); + } + } + + /** + * Returns all the YANG files present in a directory recursively. + * + * @param dir path of the directory + * @param yangFiles list of YANG files + */ + private static void getYangFiles(File dir, List yangFiles) { + if (dir.exists()) { + File[] files = dir.listFiles(); + if (files != null) { + for (File file : files) { + if (file.isFile() && file.getName().endsWith(YANG)) { + yangFiles.add(file); + } else if (file.isDirectory()) { + getYangFiles(file, yangFiles); + } + } + } + } + } +} diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfapiCallNode.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfapiCallNode.java deleted file mode 100644 index 87cb92bc5..000000000 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfapiCallNode.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - CCSDK - * ================================================================================ - * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.ccsdk.sli.plugins.restconfapicall; - -import java.util.Map; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; - -/** - * Representation of a plugin to enable RESTCONF based CRUD operations from DG. - */ -public class RestconfapiCallNode implements SvcLogicJavaPlugin { - - public RestconfapiCallNode() { - } - - /** - * Allows Directed Graphs the ability to interact with RESTCONF APIs. - * @param parameters HashMap of parameters passed by the DG to this function - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to YANG directory that can be used to build a request/sdncopt/bvc/resconfapi/test
restapiUrlMandatoryurl to send the request tohttps://sdncodl:8543/restconf/operations/L3VNF-API:create-update-vnf-request
restapiUserOptionaluser name to use for http basic authenticationsdnc_ws
restapiPasswordOptionalunencrypted password to use for http basic authenticationplain_password
contentTypeOptionalhttp content type to set in the http headerusually application/json or application/xml
formatOptionalshould match request body formatjson or xml
httpMethodOptionalhttp method to use when sending the requestget post put delete patch
responsePrefixOptionallocation the response will be written to in context memorytmp.resconftapi.result
skipSendingOptionaltrue or false
convertResponse Optionalwhether the response should be convertedtrue or false
customHttpHeadersOptionala list additional http headers to be passed in, follow the format in the exampleX-CSI-MessageId=messageId,headerFieldName=headerFieldValue
dumpHeadersOptionalwhen true writes http header content to context memorytrue or false
- * @param ctx Reference to context memory - * @throws SvcLogicException - * @since 11.0.2 - * @see String#split(String, int) - */ - public void sendRequest(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - //TODO - } - -} diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java index 34bb2ee6e..0490b3a51 100644 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java @@ -24,7 +24,7 @@ import org.glassfish.jersey.media.sse.EventSource; import org.glassfish.jersey.media.sse.SseFeature; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.restconfapicall.RestconfapiCallNode; +import org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,7 +46,7 @@ public class RestconfDiscoveryNode implements SvcLogicDiscoveryPlugin { private ExecutorService executor = Executors.newCachedThreadPool(); private Map runnableInfo = new ConcurrentHashMap<>(); - private RestconfapiCallNode restconfapiCallNode; + private RestconfApiCallNode restconfApiCallNode; private volatile Map subscriptionInfoMap = new ConcurrentHashMap<>(); private volatile LinkedBlockingQueue eventQueue = new LinkedBlockingQueue<>(); @@ -78,7 +78,7 @@ public class RestconfDiscoveryNode implements SvcLogicDiscoveryPlugin { throw new SvcLogicException("Subscriber Id is null"); } - restconfapiCallNode.sendRequest(paramMap, ctx); + restconfApiCallNode.sendRequest(paramMap, ctx); if (getResponseCode(paramMap.get(RESPONSE_PREFIX), ctx).equals(RESPONSE_CODE_200)) { // TODO: save subscription id and subscriber in MYSQL @@ -207,8 +207,8 @@ public class RestconfDiscoveryNode implements SvcLogicDiscoveryPlugin { * * @return restconfApiCallNode */ - protected RestconfapiCallNode restconfapiCallNode() { - return restconfapiCallNode; + protected RestconfApiCallNode restconfapiCallNode() { + return restconfApiCallNode; } /** @@ -216,8 +216,8 @@ public class RestconfDiscoveryNode implements SvcLogicDiscoveryPlugin { * * @param node restconfApiCallNode */ - void restconfapiCallNode(RestconfapiCallNode node) { - restconfapiCallNode = node; + void restconfapiCallNode(RestconfApiCallNode node) { + restconfApiCallNode = node; } Map subscriptionInfoMap() { diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/MdsalSerializerHelper.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/MdsalSerializerHelper.java index a3e30c4b7..5a898dfc5 100644 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/MdsalSerializerHelper.java +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/MdsalSerializerHelper.java @@ -76,8 +76,8 @@ public class MdsalSerializerHelper extends SerializerHelper - + - + diff --git a/restconf-client/provider/src/main/resources/META-INF/spring/restconf-client-osgi-context.xml b/restconf-client/provider/src/main/resources/META-INF/spring/restconf-client-osgi-context.xml index d56e2fc11..5a9f22bed 100644 --- a/restconf-client/provider/src/main/resources/META-INF/spring/restconf-client-osgi-context.xml +++ b/restconf-client/provider/src/main/resources/META-INF/spring/restconf-client-osgi-context.xml @@ -26,7 +26,7 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml b/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml index 149ed9fcf..91c31efc5 100755 --- a/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml +++ b/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml @@ -23,12 +23,12 @@ xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0" odl:use-default-for-reference-types="true"> - + - org.onap.ccsdk.sli.plugins.restconfapicall.RestconfapiCallNode + org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode -- cgit 1.2.3-korg From 6a8381e0f724955e520ef03b775024b4e515d837 Mon Sep 17 00:00:00 2001 From: gaurav Date: Mon, 10 Sep 2018 18:21:44 +0530 Subject: Dependency management for Restconf Client Changes includes: - Upgrade Restapicallnode implementation to use latest version of JAX-RS and sun.jersey versions to align with RestconfClient which is using latest versions for SSE support. This solve problem 1 as specified in the JIRA. Change-Id: If641acbca247f8ad0e804161fb97f88c293ba43a Issue-ID: CCSDK-567 Signed-off-by: Gaurav Agrawal --- restapi-call-node/provider/pom.xml | 42 +- .../sli/plugins/restapicall/RestapiCallNode.java | 816 +++++++++++---------- 2 files changed, 454 insertions(+), 404 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 6670cfd8c..942c4f32f 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 @@ -21,9 +22,9 @@ - junit - junit - test + javax.ws.rs + javax.ws.rs-api + 2.1 org.onap.ccsdk.sli.core @@ -38,22 +39,35 @@ slf4j-api - com.sun.jersey - jersey-client + org.glassfish.jersey.security + oauth1-signature + ${glassfish.version} - com.sun.jersey.contribs.jersey-oauth - oauth-signature - ${jersey.version} - - - com.sun.jersey.contribs.jersey-oauth - oauth-client - ${jersey.version} + org.glassfish.jersey.security + oauth1-client + ${glassfish.version} org.codehaus.jettison jettison + + org.glassfish.jersey.core + jersey-client + ${glassfish.version} + + + org.glassfish.jersey.inject + jersey-hk2 + ${glassfish.version} + + + + + junit + junit + test + diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 6a9e81bcc..e5503435b 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -21,33 +21,10 @@ package org.onap.ccsdk.sli.plugins.restapicall; -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientHandlerException; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.UniformInterfaceException; -import com.sun.jersey.api.client.WebResource; -import com.sun.jersey.api.client.config.ClientConfig; -import com.sun.jersey.api.client.config.DefaultClientConfig; -import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; -import com.sun.jersey.api.client.filter.HTTPDigestAuthFilter; -import com.sun.jersey.client.urlconnection.HTTPSProperties; -import com.sun.jersey.oauth.client.OAuthClientFilter; -import com.sun.jersey.oauth.signature.OAuthParameters; -import com.sun.jersey.oauth.signature.OAuthSecrets; -import org.apache.commons.lang3.StringUtils; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import static java.lang.Boolean.valueOf; +import static javax.ws.rs.client.Entity.entity; +import static org.onap.ccsdk.sli.plugins.restapicall.AuthType.fromString; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.ws.rs.core.EntityTag; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.UriBuilder; import java.io.FileInputStream; import java.io.IOException; import java.net.SocketException; @@ -64,29 +41,42 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; - -import static java.lang.Boolean.valueOf; -import static org.onap.ccsdk.sli.plugins.restapicall.AuthType.fromString; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.ws.rs.ProcessingException; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.EntityTag; +import javax.ws.rs.core.Feature; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; +import org.apache.commons.lang3.StringUtils; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; +import org.glassfish.jersey.client.oauth1.ConsumerCredentials; +import org.glassfish.jersey.client.oauth1.OAuth1ClientSupport; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RestapiCallNode implements SvcLogicJavaPlugin { - private static final Logger log = LoggerFactory.getLogger(RestapiCallNode.class); - - private String uebServers; - private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; - protected RetryPolicyStore retryPolicyStore; protected static final String DME2_PROPERTIES_FILE_NAME = "dme2.properties"; protected static final String UEB_PROPERTIES_FILE_NAME = "ueb.properties"; protected static final String DEFAULT_PROPERTIES_DIR = "/opt/onap/ccsdk/data/properties"; protected static final String PROPERTIES_DIR_KEY = "SDNC_CONFIG_DIR"; - public RetryPolicyStore getRetryPolicyStore() { - return retryPolicyStore; - } - - public void setRetryPolicyStore(RetryPolicyStore retryPolicyStore) { - this.retryPolicyStore = retryPolicyStore; - } + private static final Logger log = LoggerFactory.getLogger(RestapiCallNode.class); + protected RetryPolicyStore retryPolicyStore; + private String uebServers; + private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; public RestapiCallNode() { String configDir = System.getProperty(PROPERTIES_DIR_KEY, DEFAULT_PROPERTIES_DIR); @@ -111,7 +101,157 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } } - /** + /** + * Returns parameters from the parameter map. + * + * @param paramMap parameter map + * @param p parameters instance + * @return parameters filed instance + * @throws SvcLogicException when svc logic exception occurs + */ + public static Parameters getParameters(Map paramMap, + Parameters p) + throws SvcLogicException { + p.templateFileName = parseParam(paramMap, "templateFileName", + false, null); + p.requestBody = parseParam(paramMap, "requestBody", false, null); + p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); + validateUrl(p.restapiUrl); + p.restapiUser = parseParam(paramMap, "restapiUser", false, null); + p.restapiPassword = parseParam(paramMap, "restapiPassword", false, + null); + p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", + false, null); + p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", + false, null); + p.oAuthSignatureMethod = parseParam(paramMap, "oAuthSignatureMethod", + false, null); + p.oAuthVersion = parseParam(paramMap, "oAuthVersion", false, null); + p.contentType = parseParam(paramMap, "contentType", false, null); + p.format = Format.fromString(parseParam(paramMap, "format", false, + "json")); + p.authtype = fromString(parseParam(paramMap, "authType", false, + "unspecified")); + p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", + false, "post")); + p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + p.listNameList = getListNameList(paramMap); + String skipSendingStr = paramMap.get("skipSending"); + p.skipSending = "true".equalsIgnoreCase(skipSendingStr); + p.convertResponse = valueOf(parseParam(paramMap, "convertResponse", + false, "true")); + p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", + false, null); + p.trustStorePassword = parseParam(paramMap, "trustStorePassword", + false, null); + p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", + false, null); + p.keyStorePassword = parseParam(paramMap, "keyStorePassword", + false, null); + p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null + && p.keyStoreFileName != null && p.keyStorePassword != null; + p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", + false, null); + p.partner = parseParam(paramMap, "partner", false, null); + p.dumpHeaders = valueOf(parseParam(paramMap, "dumpHeaders", + false, null)); + p.returnRequestPayload = valueOf(parseParam( + paramMap, "returnRequestPayload", false, null)); + return p; + } + + /** + * Validates the given URL in the parameters. + * + * @param restapiUrl rest api URL + * @throws SvcLogicException when URL validation fails + */ + private static void validateUrl(String restapiUrl) + throws SvcLogicException { + try { + URI.create(restapiUrl); + } catch (IllegalArgumentException e) { + throw new SvcLogicException("Invalid input of url " + + e.getLocalizedMessage(), e); + } + } + + /** + * Returns the list of list name. + * + * @param paramMap parameters map + * @return list of list name + */ + private static Set getListNameList(Map paramMap) { + Set ll = new HashSet<>(); + for (Map.Entry entry : paramMap.entrySet()) { + if (entry.getKey().startsWith("listName")) { + ll.add(entry.getValue()); + } + } + return ll; + } + + /** + * Parses the parameter string map of property, validates if required, + * assigns default value if present and returns the value. + * + * @param paramMap string param map + * @param name name of the property + * @param required if value required + * @param def default value + * @return value of the property + * @throws SvcLogicException if required parameter value is empty + */ + public static String parseParam(Map paramMap, String name, + boolean required, String def) + throws SvcLogicException { + String s = paramMap.get(name); + + if (s == null || s.trim().length() == 0) { + if (!required) { + return def; + } + throw new SvcLogicException("Parameter " + name + " is required in RestapiCallNode"); + } + + s = s.trim(); + StringBuilder value = new StringBuilder(); + int i = 0; + int i1 = s.indexOf('%'); + while (i1 >= 0) { + int i2 = s.indexOf('%', i1 + 1); + if (i2 < 0) { + break; + } + + String varName = s.substring(i1 + 1, i2); + String varValue = System.getenv(varName); + if (varValue == null) { + varValue = "%" + varName + "%"; + } + + value.append(s.substring(i, i1)); + value.append(varValue); + + i = i2 + 1; + i1 = s.indexOf('%', i); + } + value.append(s.substring(i)); + + log.info("Parameter {}: [{}]", name, value); + return value.toString(); + } + + public RetryPolicyStore getRetryPolicyStore() { + return retryPolicyStore; + } + + public void setRetryPolicyStore(RetryPolicyStore retryPolicyStore) { + this.retryPolicyStore = retryPolicyStore; + } + + /** * Allows Directed Graphs the ability to interact with REST APIs. * @param paramMap HashMap of parameters passed by the DG to this function * @@ -148,7 +288,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } public void sendRequest(Map paramMap, SvcLogicContext ctx, Integer retryCount) - throws SvcLogicException { + throws SvcLogicException { RetryPolicy retryPolicy = null; HttpResponse r = new HttpResponse(); @@ -174,9 +314,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { ctx.setAttribute(pp + "header." + a.getKey(), StringUtils.join(a.getValue(), ",")); } } - + if (p.returnRequestPayload && req != null) { - ctx.setAttribute(pp + "httpRequest", req); + ctx.setAttribute(pp + "httpRequest", req); } if (r.body != null && r.body.trim().length() > 0) { @@ -184,14 +324,17 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (p.convertResponse) { Map mm = null; - if (p.format == Format.XML) + if (p.format == Format.XML) { mm = XmlParser.convertToProperties(r.body, p.listNameList); - else if (p.format == Format.JSON) + } else if (p.format == Format.JSON) { mm = JsonParser.convertToProperties(r.body); + } - if (mm != null) - for (Map.Entry entry : mm.entrySet()) + if (mm != null) { + for (Map.Entry entry : mm.entrySet()) { ctx.setAttribute(pp + entry.getKey(), entry.getValue()); + } + } } } } catch (SvcLogicException e) { @@ -209,7 +352,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { retryCount = 0; } String retryMessage = retryCount + " attempts were made out of " + retryPolicy.getMaximumRetries() + - " maximum retries."; + " maximum retries."; log.debug(retryMessage); try { retryCount = retryCount + 1; @@ -219,7 +362,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { String retryString = retryPolicy.getNextHostName(uri.toString()); URI uriTwo = new URI(retryString); URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port(uriTwo.getPort()).scheme( - uriTwo.getScheme()).build(); + uriTwo.getScheme()).build(); paramMap.put("restapiUrl", retryUri.toString()); log.debug("URL was set to {}", retryUri.toString()); log.debug("Failed to communicate with host {}. Request will be re-attempted using the host {}.", @@ -233,152 +376,16 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } catch (Exception ex) { log.error("Could not attempt retry.", ex); String retryErrorMessage = - "Retry attempt has failed. No further retry shall be attempted, calling " + - "setFailureResponseStatus."; + "Retry attempt has failed. No further retry shall be attempted, calling " + + "setFailureResponseStatus."; setFailureResponseStatus(ctx, prefix, retryErrorMessage, r); } } } - if (r != null && r.code >= 300) + if (r != null && r.code >= 300) { throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); - } - - /** - * Returns parameters from the parameter map. - * - * @param paramMap parameter map - * @param p parameters instance - * @return parameters filed instance - * @throws SvcLogicException when svc logic exception occurs - */ - public static Parameters getParameters(Map paramMap, - Parameters p) - throws SvcLogicException { - p.templateFileName = parseParam(paramMap, "templateFileName", - false, null); - p.requestBody = parseParam(paramMap, "requestBody", false, null); - p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); - validateUrl(p.restapiUrl); - p.restapiUser = parseParam(paramMap, "restapiUser", false, null); - p.restapiPassword = parseParam(paramMap, "restapiPassword", false, - null); - p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", - false, null); - p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", - false, null); - p.oAuthSignatureMethod = parseParam(paramMap, "oAuthSignatureMethod", - false, null); - p.oAuthVersion = parseParam(paramMap, "oAuthVersion", false, null); - p.contentType = parseParam(paramMap, "contentType", false, null); - p.format = Format.fromString(parseParam(paramMap, "format", false, - "json")); - p.authtype = fromString(parseParam(paramMap, "authType", false, - "unspecified")); - p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", - false, "post")); - p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); - p.listNameList = getListNameList(paramMap); - String skipSendingStr = paramMap.get("skipSending"); - p.skipSending = "true".equalsIgnoreCase(skipSendingStr); - p.convertResponse = valueOf(parseParam(paramMap, "convertResponse", - false, "true")); - p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", - false, null); - p.trustStorePassword = parseParam(paramMap, "trustStorePassword", - false, null); - p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", - false, null); - p.keyStorePassword = parseParam(paramMap, "keyStorePassword", - false, null); - p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null - && p.keyStoreFileName != null && p.keyStorePassword != null; - p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", - false, null); - p.partner = parseParam(paramMap, "partner", false, null); - p.dumpHeaders = valueOf(parseParam(paramMap, "dumpHeaders", - false, null)); - p.returnRequestPayload = valueOf(parseParam( - paramMap, "returnRequestPayload", false, null)); - return p; - } - - /** - * Validates the given URL in the parameters. - * - * @param restapiUrl rest api URL - * @throws SvcLogicException when URL validation fails - */ - private static void validateUrl(String restapiUrl) - throws SvcLogicException { - try { - URI.create(restapiUrl); - } catch (IllegalArgumentException e) { - throw new SvcLogicException("Invalid input of url " - + e.getLocalizedMessage(), e); - } - } - - /** - * Returns the list of list name. - * - * @param paramMap parameters map - * @return list of list name - */ - private static Set getListNameList(Map paramMap) { - Set ll = new HashSet<>(); - for (Map.Entry entry : paramMap.entrySet()) - if (entry.getKey().startsWith("listName")) - ll.add(entry.getValue()); - return ll; - } - - /** - * Parses the parameter string map of property, validates if required, - * assigns default value if present and returns the value. - * - * @param paramMap string param map - * @param name name of the property - * @param required if value required - * @param def default value - * @return value of the property - * @throws SvcLogicException if required parameter value is empty - */ - public static String parseParam(Map paramMap, String name, - boolean required, String def) - throws SvcLogicException { - String s = paramMap.get(name); - - if (s == null || s.trim().length() == 0) { - if (!required) - return def; - throw new SvcLogicException("Parameter " + name + " is required in RestapiCallNode"); } - - s = s.trim(); - StringBuilder value = new StringBuilder(); - int i = 0; - int i1 = s.indexOf('%'); - while (i1 >= 0) { - int i2 = s.indexOf('%', i1 + 1); - if (i2 < 0) - break; - - String varName = s.substring(i1 + 1, i2); - String varValue = System.getenv(varName); - if (varValue == null) - varValue = "%" + varName + "%"; - - value.append(s.substring(i, i1)); - value.append(varValue); - - i = i2 + 1; - i1 = s.indexOf('%', i); - } - value.append(s.substring(i)); - - log.info("Parameter {}: [{}]", name, value); - return value.toString(); } protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) @@ -389,8 +396,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { template = expandRepeats(ctx, template, 1); Map mm = new HashMap<>(); - for (String s : ctx.getAttributeKeySet()) + for (String s : ctx.getAttributeKeySet()) { mm.put(s, ctx.getAttribute(s)); + } StringBuilder ss = new StringBuilder(); int i = 0; @@ -402,8 +410,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } int i2 = template.indexOf('}', i1 + 2); - if (i2 < 0) + if (i2 < 0) { throw new SvcLogicException("Template error: Matching } not found"); + } String var1 = template.substring(i1 + 2, i2); String value1 = format == Format.XML ? XmlJsonUtil.getXml(mm, var1) : XmlJsonUtil.getJson(mm, var1); @@ -411,14 +420,17 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (value1 == null || value1.trim().length() == 0) { // delete the whole element (line) int i3 = template.lastIndexOf('\n', i1); - if (i3 < 0) + if (i3 < 0) { i3 = 0; + } int i4 = template.indexOf('\n', i1); - if (i4 < 0) + if (i4 < 0) { i4 = template.length(); + } - if (i < i3) + if (i < i3) { ss.append(template.substring(i, i3)); + } i = i4; } else { ss.append(template.substring(i, i1)).append(value1); @@ -427,10 +439,11 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } String req = format == Format.XML - ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) : XmlJsonUtil.removeEmptyStructJson(ss.toString()); + ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) : XmlJsonUtil.removeEmptyStructJson(ss.toString()); - if (format == Format.JSON) + if (format == Format.JSON) { req = XmlJsonUtil.removeLastCommaJson(req); + } long t2 = System.currentTimeMillis(); log.info("Building {} completed. Time: {}", format, (t2 - t1)); @@ -449,9 +462,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } int i2 = template.indexOf(':', i1 + 9); - if (i2 < 0) + if (i2 < 0) { throw new SvcLogicException( - "Template error: Context variable name followed by : is required after repeat"); + "Template error: Context variable name followed by : is required after repeat"); + } // Find the closing }, store in i3 int nn = 1; @@ -459,8 +473,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { int i = i2; while (nn > 0 && i < template.length()) { i3 = template.indexOf('}', i); - if (i3 < 0) + if (i3 < 0) { throw new SvcLogicException("Template error: Matching } not found"); + } int i32 = template.indexOf('{', i); if (i32 >= 0 && i32 < i3) { nn++; @@ -489,8 +504,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { String ss = rpt.replaceAll("\\[\\$\\{" + level + "\\}\\]", "[" + ii + "]"); if (ii == n - 1 && ss.trim().endsWith(",")) { int i4 = ss.lastIndexOf(','); - if (i4 > 0) + if (i4 > 0) { ss = ss.substring(0, i4) + ss.substring(i4 + 1); + } } newTemplate.append(ss); } @@ -498,8 +514,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { k = i3 + 1; } - if (k == 0) + if (k == 0) { return newTemplate.toString(); + } return expandRepeats(ctx, newTemplate.toString(), level + 1); } @@ -522,52 +539,47 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.oAuthConsumerSecret = fp.oAuthConsumerSecret; p.oAuthSignatureMethod = fp.oAuthSignatureMethod; p.authtype = fp.authtype; - return addAuthType(c,p); + return addAuthType(c, p); } protected Client addAuthType(Client client, Parameters p) throws SvcLogicException { - if (p.authtype == AuthType.Unspecified){ - if (p.restapiUser != null && p.restapiPassword != null) - client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); - else if(p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null - && p.oAuthSignatureMethod != null) { - OAuthParameters params = new OAuthParameters() - .signatureMethod(p.oAuthSignatureMethod) - .consumerKey(p.oAuthConsumerKey) - .version(p.oAuthVersion); - - OAuthSecrets secrets = new OAuthSecrets() - .consumerSecret(p.oAuthConsumerSecret); - client.addFilter(new OAuthClientFilter(client.getProviders(), params, secrets)); + if (p.authtype == AuthType.Unspecified) { + if (p.restapiUser != null && p.restapiPassword != null) { + client.register(HttpAuthenticationFeature.basic(p.restapiUser, p.restapiPassword)); + } else if (p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null + && p.oAuthSignatureMethod != null) { + Feature oAuth1Feature = OAuth1ClientSupport + .builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) + .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); + client.register(oAuth1Feature); } } else { if (p.authtype == AuthType.DIGEST) { if (p.restapiUser != null && p.restapiPassword != null) { - client.addFilter(new HTTPDigestAuthFilter(p.restapiUser, p.restapiPassword)); + client.register(HttpAuthenticationFeature.digest(p.restapiUser, p.restapiPassword)); } else { - throw new SvcLogicException("oAUTH authentication type selected but all restapiUser and restapiPassword " + - "parameters doesn't exist", new Throwable()); + throw new SvcLogicException( + "oAUTH authentication type selected but all restapiUser and restapiPassword " + + "parameters doesn't exist", new Throwable()); } - } else if (p.authtype == AuthType.BASIC){ + } else if (p.authtype == AuthType.BASIC) { if (p.restapiUser != null && p.restapiPassword != null) { - client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); + client.register(HttpAuthenticationFeature.basic(p.restapiUser, p.restapiPassword)); } else { - throw new SvcLogicException("oAUTH authentication type selected but all restapiUser and restapiPassword " + - "parameters doesn't exist", new Throwable()); + throw new SvcLogicException( + "oAUTH authentication type selected but all restapiUser and restapiPassword " + + "parameters doesn't exist", new Throwable()); } - } else if(p.authtype == AuthType.OAUTH ) { - if(p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null && p.oAuthSignatureMethod != null) { - OAuthParameters params = new OAuthParameters() - .signatureMethod(p.oAuthSignatureMethod) - .consumerKey(p.oAuthConsumerKey) - .version(p.oAuthVersion); - - OAuthSecrets secrets = new OAuthSecrets() - .consumerSecret(p.oAuthConsumerSecret); - client.addFilter(new OAuthClientFilter(client.getProviders(), params, secrets)); + } else if (p.authtype == AuthType.OAUTH) { + if (p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null && p.oAuthSignatureMethod != null) { + Feature oAuth1Feature = OAuth1ClientSupport + .builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) + .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); + client.register(oAuth1Feature); } else { - throw new SvcLogicException("oAUTH authentication type selected but all oAuthConsumerKey, oAuthConsumerSecret " + - "and oAuthSignatureMethod parameters doesn't exist", new Throwable()); + throw new SvcLogicException( + "oAUTH authentication type selected but all oAuthConsumerKey, oAuthConsumerSecret " + + "and oAuthSignatureMethod parameters doesn't exist", new Throwable()); } } } @@ -583,24 +595,25 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { * @throws SvcLogicException when sending http request fails */ public HttpResponse sendHttpRequest(String request, Parameters p) - throws SvcLogicException { + throws SvcLogicException { - ClientConfig config = new DefaultClientConfig(); SSLContext ssl = null; - if (p.ssl && p.restapiUrl.startsWith("https")) + if (p.ssl && p.restapiUrl.startsWith("https")) { ssl = createSSLContext(p); - if (ssl != null) { - HostnameVerifier hostnameVerifier = (hostname, session) -> true; - - config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, - new HTTPSProperties(hostnameVerifier, ssl)); } + Client client; - logProperties(config.getProperties()); + if (ssl != null) { + HttpsURLConnection.setDefaultSSLSocketFactory(ssl.getSocketFactory()); + client = ClientBuilder.newBuilder().sslContext(ssl).hostnameVerifier((s, sslSession) -> true) + .build(); + } else { + client = ClientBuilder.newBuilder().hostnameVerifier((s, sslSession) -> true) + .build(); + } + client.property(ClientProperties.CONNECT_TIMEOUT, 5000); - Client client = Client.create(config); - client.setConnectTimeout(5000); - WebResource webResource = addAuthType(client,p).resource(p.restapiUrl); + WebTarget webTarget = addAuthType(client, p).target(p.restapiUrl); log.info("Sending request:"); log.info(request); @@ -617,38 +630,41 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { tt1 = p.contentType; } - WebResource.Builder webResourceBuilder = webResource.accept(tt).type(tt1); - if(p.format == Format.NONE){ - webResourceBuilder = webResource.header("",""); + Invocation.Builder invocationBuilder = webTarget.request(tt1).accept(tt); + + if (p.format == Format.NONE) { + invocationBuilder.header("", ""); } if (p.customHttpHeaders != null && p.customHttpHeaders.length() > 0) { String[] keyValuePairs = p.customHttpHeaders.split(","); for (String singlePair : keyValuePairs) { int equalPosition = singlePair.indexOf('='); - webResourceBuilder.header(singlePair.substring(0, equalPosition), - singlePair.substring(equalPosition + 1, singlePair.length())); + invocationBuilder.header(singlePair.substring(0, equalPosition), + singlePair.substring(equalPosition + 1, singlePair.length())); } } - webResourceBuilder.header("X-ECOMP-RequestID",org.slf4j.MDC.get("X-ECOMP-RequestID")); + invocationBuilder.header("X-ECOMP-RequestID", org.slf4j.MDC.get("X-ECOMP-RequestID")); - ClientResponse response; + Response response; try { - response = webResourceBuilder.method(p.httpMethod.toString(), ClientResponse.class, request); - } catch (UniformInterfaceException | ClientHandlerException e) { - throw new SvcLogicException("Exception while sending http request to client " - + e.getLocalizedMessage(), e); + response = invocationBuilder.method(p.httpMethod.toString(), entity(request, tt1)); + } catch (ProcessingException | IllegalStateException e) { + throw new SvcLogicException("Exception while posting http request to client " + + e.getLocalizedMessage(), e); } r.code = response.getStatus(); - r.headers = response.getHeaders(); + r.headers = response.getStringHeaders(); EntityTag etag = response.getEntityTag(); - if (etag != null) + if (etag != null) { r.message = etag.getValue(); - if (response.hasEntity() && r.code != 204) - r.body = response.getEntity(String.class); + } + if (response.hasEntity() && r.code != 204) { + r.body = response.readEntity(String.class); + } } long t2 = System.currentTimeMillis(); @@ -718,24 +734,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { setResponseStatus(ctx, prefix, r); } - if (r != null && r.code >= 300) + if (r != null && r.code >= 300) { throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); - } - - private static class FileParam { - - public String fileName; - public String url; - public String user; - public String password; - public HttpMethod httpMethod; - public String responsePrefix; - public boolean skipSending; - public String oAuthConsumerKey; - public String oAuthConsumerSecret; - public String oAuthSignatureMethod; - public String oAuthVersion; - public AuthType authtype; + } } private FileParam getFileParameters(Map paramMap) throws SvcLogicException { @@ -756,11 +757,51 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return p; } + public void postMessageOnUeb(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { + HttpResponse r; + try { + UebParam p = getUebParameters(paramMap); + + String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; + + String req; + + if (p.templateFileName == null) { + log.info("No template file name specified. Using default UEB template: {}", defaultUebTemplateFileName); + p.templateFileName = defaultUebTemplateFileName; + } + + String reqTemplate = readFile(p.templateFileName); + reqTemplate = reqTemplate.replaceAll("rootVarName", p.rootVarName); + req = buildXmlJsonRequest(ctx, reqTemplate, Format.JSON); + + r = postOnUeb(req, p); + setResponseStatus(ctx, p.responsePrefix, r); + if (r.body != null) { + ctx.setAttribute(pp + "httpResponse", r.body); + } + + } catch (SvcLogicException e) { + log.error("Error sending the request: {}", e.getMessage(), e); + + r = new HttpResponse(); + r.code = 500; + r.message = e.getMessage(); + String prefix = parseParam(paramMap, "responsePrefix", false, null); + setResponseStatus(ctx, prefix, r); + } + + if (r.code >= 300) { + throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); + } + } + protected HttpResponse sendHttpData(byte[] data, FileParam p) throws SvcLogicException { - Client client = Client.create(); - client.setConnectTimeout(5000); - client.setFollowRedirects(true); - WebResource webResource = addAuthType(client,p).resource(p.url); + + Client client = ClientBuilder.newBuilder().build(); + client.property(ClientProperties.CONNECT_TIMEOUT, 5000); + client.property(ClientProperties.FOLLOW_REDIRECTS, true); + WebTarget webTarget = addAuthType(client, p).target(p.url); log.info("Sending file"); long t1 = System.currentTimeMillis(); @@ -770,53 +811,62 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (!p.skipSending) { String tt = "application/octet-stream"; + Invocation.Builder invocationBuilder = webTarget.request(tt).accept(tt); + + Response response; - ClientResponse response; try { - if (p.httpMethod == HttpMethod.POST) - response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); - else if (p.httpMethod == HttpMethod.PUT) - response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); - else + if (p.httpMethod == HttpMethod.POST) { + response = invocationBuilder.post(Entity.entity(data, tt)); + } else if (p.httpMethod == HttpMethod.PUT) { + response = invocationBuilder.put(Entity.entity(data, tt)); + } else { throw new SvcLogicException("Http operation" + p.httpMethod + "not supported"); - } catch (UniformInterfaceException | ClientHandlerException e) { - throw new SvcLogicException("Exception while sending http request to client " + + } + } catch (ProcessingException e) { + throw new SvcLogicException("Exception while posting http request to client " + e.getLocalizedMessage(), e); } r.code = response.getStatus(); - r.headers = response.getHeaders(); + r.headers = response.getStringHeaders(); EntityTag etag = response.getEntityTag(); - if (etag != null) + if (etag != null) { r.message = etag.getValue(); - if (response.hasEntity() && r.code != 204) - r.body = response.getEntity(String.class); + } + if (response.hasEntity() && r.code != 204) { + r.body = response.readEntity(String.class); + } if (r.code == 301) { - String newUrl = response.getHeaders().getFirst("Location"); + String newUrl = response.getStringHeaders().getFirst("Location"); log.info("Got response code 301. Sending same request to URL: {}", newUrl); - webResource = client.resource(newUrl); + webTarget = client.target(newUrl); + invocationBuilder = webTarget.request(tt).accept(tt); try { - if (p.httpMethod == HttpMethod.POST) - response = webResource.accept(tt).type(tt).post(ClientResponse.class, data); - else if (p.httpMethod == HttpMethod.PUT) - response = webResource.accept(tt).type(tt).put(ClientResponse.class, data); - else + if (p.httpMethod == HttpMethod.POST) { + response = invocationBuilder.post(Entity.entity(data, tt)); + } else if (p.httpMethod == HttpMethod.PUT) { + response = invocationBuilder.put(Entity.entity(data, tt)); + } else { throw new SvcLogicException("Http operation" + p.httpMethod + "not supported"); - } catch (UniformInterfaceException | ClientHandlerException e) { - throw new SvcLogicException("Exception while sending http request to client " + + } + } catch (ProcessingException e) { + throw new SvcLogicException("Exception while posting http request to client " + e.getLocalizedMessage(), e); } r.code = response.getStatus(); etag = response.getEntityTag(); - if (etag != null) + if (etag != null) { r.message = etag.getValue(); - if (response.hasEntity() && r.code != 204) - r.body = response.getEntity(String.class); + } + if (response.hasEntity() && r.code != 204) { + r.body = response.readEntity(String.class); + } } } @@ -830,52 +880,6 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return r; } - public void postMessageOnUeb(Map paramMap, SvcLogicContext ctx) throws SvcLogicException { - HttpResponse r; - try { - UebParam p = getUebParameters(paramMap); - - String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; - - String req; - - if (p.templateFileName == null) { - log.info("No template file name specified. Using default UEB template: {}", defaultUebTemplateFileName); - p.templateFileName = defaultUebTemplateFileName; - } - - String reqTemplate = readFile(p.templateFileName); - reqTemplate = reqTemplate.replaceAll("rootVarName", p.rootVarName); - req = buildXmlJsonRequest(ctx, reqTemplate, Format.JSON); - - r = postOnUeb(req, p); - setResponseStatus(ctx, p.responsePrefix, r); - if (r.body != null) - ctx.setAttribute(pp + "httpResponse", r.body); - - } catch (SvcLogicException e) { - log.error("Error sending the request: {}", e.getMessage(), e); - - r = new HttpResponse(); - r.code = 500; - r.message = e.getMessage(); - String prefix = parseParam(paramMap, "responsePrefix", false, null); - setResponseStatus(ctx, prefix, r); - } - - if (r.code >= 300) - throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message); - } - - private static class UebParam { - - public String topic; - public String templateFileName; - public String rootVarName; - public String responsePrefix; - public boolean skipSending; - } - private UebParam getUebParameters(Map paramMap) throws SvcLogicException { UebParam p = new UebParam(); p.topic = parseParam(paramMap, "topic", true, null); @@ -887,17 +891,49 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return p; } + protected void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) { + ll.add((String) o); + } + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) { + log.info("--- {}:{}", name, String.valueOf(mm.get(name))); + } + } + + protected void logHeaders(MultivaluedMap mm) { + log.info("HTTP response headers:"); + + if (mm == null) { + return; + } + + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) { + ll.add((String) o); + } + Collections.sort(ll); + + for (String name : ll) { + log.info("--- {}:{}", name, String.valueOf(mm.get(name))); + } + } + protected HttpResponse postOnUeb(String request, UebParam p) throws SvcLogicException { String[] urls = uebServers.split(" "); for (int i = 0; i < urls.length; i++) { - if (!urls[i].endsWith("/")) + if (!urls[i].endsWith("/")) { urls[i] += "/"; + } urls[i] += "events/" + p.topic; } - Client client = Client.create(); - client.setConnectTimeout(5000); - WebResource webResource = client.resource(urls[0]); + Client client = ClientBuilder.newBuilder().build(); + client.property(ClientProperties.CONNECT_TIMEOUT, 5000); + WebTarget webTarget = client.target(urls[0]); log.info("UEB URL: {}", urls[0]); log.info("Sending request:"); @@ -911,19 +947,20 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { String tt = "application/json"; String tt1 = tt + ";charset=UTF-8"; - ClientResponse response; + Response response; + Invocation.Builder invocationBuilder = webTarget.request(tt1).accept(tt); try { - response = webResource.accept(tt).type(tt1).post(ClientResponse.class, request); - } catch (UniformInterfaceException | ClientHandlerException e) { + response = invocationBuilder.post(Entity.entity(request, tt1)); + } catch (ProcessingException e) { throw new SvcLogicException("Exception while posting http request to client " + e.getLocalizedMessage(), e); } - r.code = response.getStatus(); - r.headers = response.getHeaders(); - if (response.hasEntity()) - r.body = response.getEntity(String.class); + r.headers = response.getStringHeaders(); + if (response.hasEntity()) { + r.body = response.readEntity(String.class); + } } long t2 = System.currentTimeMillis(); @@ -935,37 +972,36 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return r; } - protected void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - log.info("Properties:"); - for (String name : ll) - log.info("--- {}:{}", name, String.valueOf(mm.get(name))); + public void setUebServers(String uebServers) { + this.uebServers = uebServers; } - protected void logHeaders(MultivaluedMap mm) { - log.info("HTTP response headers:"); - - if (mm == null) - return; + public void setDefaultUebTemplateFileName(String defaultUebTemplateFileName) { + this.defaultUebTemplateFileName = defaultUebTemplateFileName; + } - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); + private static class FileParam { - for (String name : ll) - log.info("--- {}:{}", name, String.valueOf(mm.get(name))); + public String fileName; + public String url; + public String user; + public String password; + public HttpMethod httpMethod; + public String responsePrefix; + public boolean skipSending; + public String oAuthConsumerKey; + public String oAuthConsumerSecret; + public String oAuthSignatureMethod; + public String oAuthVersion; + public AuthType authtype; } - public void setUebServers(String uebServers) { - this.uebServers = uebServers; - } + private static class UebParam { - public void setDefaultUebTemplateFileName(String defaultUebTemplateFileName) { - this.defaultUebTemplateFileName = defaultUebTemplateFileName; + public String topic; + public String templateFileName; + public String rootVarName; + public String responsePrefix; + public boolean skipSending; } -} +} \ No newline at end of file -- cgit 1.2.3-korg From 00182e7710a239e871c33a42cf9eaf9a12d90ecb Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 26 Sep 2018 10:44:42 -0400 Subject: Prepare for release build Update for release build : (a) Remove -STAGING tag from release version in version.properties (b) Update to use released version of parent poms (c) Disable single-feature-test (which does not work with released dependencies from ONAP) Change-Id: I97ecca353e8e2b4e96699980c90fda9047d22791 Issue-ID: CCSDK-597 Signed-off-by: Timoney, Dan (dt5972) --- features/ccsdk-sli-plugins-all/pom.xml | 7 ++++++- features/features-sli-plugins/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 7 ++++++- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 2 +- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 7 ++++++- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- restconf-client/features/ccsdk-restconf-client/pom.xml | 7 ++++++- restconf-client/features/features-restconf-client/pom.xml | 2 +- restconf-client/features/pom.xml | 2 +- restconf-client/installer/pom.xml | 2 +- restconf-client/pom.xml | 2 +- restconf-client/provider/pom.xml | 2 +- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 7 ++++++- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/pom.xml | 2 +- sshapi-call-node/installer/pom.xml | 2 +- sshapi-call-node/pom.xml | 2 +- sshapi-call-node/provider/pom.xml | 2 +- template-node/features/ccsdk-template-node/pom.xml | 2 +- template-node/features/features-template-node/pom.xml | 2 +- template-node/features/pom.xml | 2 +- template-node/installer/pom.xml | 2 +- template-node/pom.xml | 2 +- template-node/provider/pom.xml | 2 +- version.properties | 2 +- 36 files changed, 61 insertions(+), 36 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index 051f3a463..b053dcb5b 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0-SNAPSHOT + 1.1.0 @@ -17,6 +17,11 @@ feature ccsdk-sli-plugins :: features :: ${project.artifactId} + + + true + + diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index 0b43d1a0d..c1758f8c4 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 050d3e9d5..c81c6a275 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/features/pom.xml b/features/pom.xml index 3ac87bf6b..d342ee8a8 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/pom.xml b/pom.xml index a41f2311c..376433d52 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index fd38cb224..b2dc224a8 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0-SNAPSHOT + 1.1.0 @@ -17,6 +17,11 @@ ccsdk-sli-plugins :: properties-node :: ${project.artifactId} + + true + + + diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index e8f168e2b..1d0535d43 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index dd0e824f0..9cccc4991 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 965bdbb77..bff0978ce 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index eb7dcbb51..73098287b 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index a9a3c94d5..ad9a8fe6c 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 822a6d1e7..a73a14286 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0-SNAPSHOT + 1.1.0 @@ -18,6 +18,11 @@ ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + + + true + + diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index dfcef32f4..507b86628 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 14e9ae022..fb23ebda1 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 8e2f402eb..24c5f44ec 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 641bcc863..3333dc546 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 6670cfd8c..844a6b5e7 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 1877f19d8..64b8216b4 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0-SNAPSHOT + 1.1.0 @@ -18,6 +18,11 @@ ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} + + + true + + diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 8ee5e7e21..13be4bb5d 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index c94be00be..cd58d20e1 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index b28cefde9..c71d5dad5 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index fecbd2b93..af55f8037 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index db0bee061..35944f4f4 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index 7b74d6de9..fd0dacaed 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0-SNAPSHOT + 1.1.0 @@ -18,6 +18,11 @@ ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} + + true + + + diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index a37ac6172..7435e602a 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 49b96e3fd..5ff6cceb5 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 51bed972f..d33ecb58a 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 91b52e123..b2aa2b9c4 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index d37972efc..0cb0294c2 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index fd3a92457..166b74674 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index c352ba514..ef58da04c 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0-SNAPSHOT + 1.1.0 diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 1abcdbe3e..25e6cb904 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index 1e4d24cd3..c21ffcf9f 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/template-node/pom.xml b/template-node/pom.xml index 21ab127f3..e1f08b4a4 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 936f76f37..28beb9dc8 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.0-SNAPSHOT + 1.1.0 org.onap.ccsdk.sli.plugins diff --git a/version.properties b/version.properties index 53760c8c7..ba4200853 100644 --- a/version.properties +++ b/version.properties @@ -11,6 +11,6 @@ feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version}-STAGING +release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From 85737499b931441be3013831d7ce76a5c4734032 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 26 Sep 2018 15:33:59 -0400 Subject: Roll to next snapshot Roll to next snapshot release Change-Id: I179602134b518295b4b6a1d53cea8136ad0ba666 Issue-ID: CCSDK-597 Signed-off-by: Timoney, Dan (dt5972) --- features/ccsdk-sli-plugins-all/pom.xml | 7 ++----- features/features-sli-plugins/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 7 ++----- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 7 ++----- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- restconf-client/features/ccsdk-restconf-client/pom.xml | 7 ++----- restconf-client/features/features-restconf-client/pom.xml | 4 ++-- restconf-client/features/pom.xml | 4 ++-- restconf-client/installer/pom.xml | 4 ++-- restconf-client/pom.xml | 4 ++-- restconf-client/provider/pom.xml | 8 ++++---- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 7 ++----- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/pom.xml | 4 ++-- sshapi-call-node/installer/pom.xml | 4 ++-- sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/provider/pom.xml | 4 ++-- template-node/features/ccsdk-template-node/pom.xml | 7 ++----- template-node/features/features-template-node/pom.xml | 4 ++-- template-node/features/pom.xml | 4 ++-- template-node/installer/pom.xml | 4 ++-- template-node/pom.xml | 4 ++-- template-node/provider/pom.xml | 4 ++-- version.properties | 4 ++-- 36 files changed, 74 insertions(+), 92 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index b053dcb5b..d4715be62 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -7,20 +7,17 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins-all - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} - - true - diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index c1758f8c4..b3333b600 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-sli-plugins - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index c81c6a275..c2b77d0fd 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-features-installer - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index d342ee8a8..257627da4 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-feature-aggregator - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: features diff --git a/pom.xml b/pom.xml index 376433d52..7a0f84a9f 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index b2dc224a8..744d6d892 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,21 +5,18 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} - - true - diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 1d0535d43..0f1b28c88 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 9cccc4991..32e139b4f 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index bff0978ce..0a6918a3e 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 73098287b..25c2cf225 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index ad9a8fe6c..7f9352341 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index a73a14286..2c616a298 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -7,21 +7,18 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - - true - diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 507b86628..8160611dd 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index fb23ebda1..55e0945e7 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 24c5f44ec..acb6ae899 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 3333dc546..f704647ab 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 844a6b5e7..84b4131c7 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 64b8216b4..03d935296 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -7,21 +7,18 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restconf-client - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} - - true - diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 13be4bb5d..166ddc53d 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-restconf-client - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index cd58d20e1..6aa3fde88 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-features - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index c71d5dad5..fd675c80a 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-installer - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index af55f8037..fccd697bb 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 35944f4f4..ac5c4cc32 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-provider - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} @@ -39,7 +39,7 @@ org.onap.ccsdk.sli.plugins properties-node-provider - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT org.opendaylight.yangtools @@ -63,7 +63,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index fd0dacaed..9220b1f78 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -7,20 +7,17 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sshapi-call-node - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} - - true - diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 7435e602a..dc924244a 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -7,13 +7,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-sshapi-call-node - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 5ff6cceb5..82e69b9b6 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -7,12 +7,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-features - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index d33ecb58a..9d570fd36 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-installer - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index b2aa2b9c4..7dda908e5 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 0cb0294c2..e4619ca04 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-provider - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index 166b74674..b7d329e59 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,18 +5,15 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-template-node - 0.3.3-SNAPSHOT + 0.3.1-SNAPSHOT feature - - true - diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index ef58da04c..021e5921b 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-template-node - 0.3.3-SNAPSHOT + 0.3.1-SNAPSHOT feature diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 25e6cb904..c918417ca 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-features - 0.3.3-SNAPSHOT + 0.3.1-SNAPSHOT pom diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index c21ffcf9f..f588f49ce 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-installer - 0.3.3-SNAPSHOT + 0.3.1-SNAPSHOT pom diff --git a/template-node/pom.xml b/template-node/pom.xml index e1f08b4a4..c2668f869 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins template-node - 0.3.3-SNAPSHOT + 0.3.1-SNAPSHOT pom diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 28beb9dc8..fa2ba9d91 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.1.0 + 1.1.1-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-provider - 0.3.3-SNAPSHOT + 0.3.1-SNAPSHOT bundle diff --git a/version.properties b/version.properties index ba4200853..1c849dae1 100644 --- a/version.properties +++ b/version.properties @@ -7,10 +7,10 @@ release_name=0 sprint_number=3 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version} +release_version=${base_version}-STAGING snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From 87850a15d93c7a1162d30c129e0dc76cd1b66f94 Mon Sep 17 00:00:00 2001 From: "shashikanth.vh" Date: Thu, 4 Oct 2018 10:40:18 +0530 Subject: Add mandatory empty construct to json template Restapicallnode remove empty parameter from json template, if template mandates empty parameter to be present then it should not be removed. Change-Id: I075e0858f956eb3aff87d2a7387b55caa3310568 Issue-ID: CCSDK-607 Signed-off-by: shashikanth.vh --- .../sli/plugins/restapicall/RestapiCallNode.java | 3 +- .../ccsdk/sli/plugins/restapicall/XmlJsonUtil.java | 11 +++-- .../plugins/sshapicall/TestRestapiCallNode.java | 55 ++++++++++++++++++++++ .../sli/plugins/sshapicall/TestXmlJsonUtil.java | 2 +- .../provider/src/test/resources/sdwan-site.json | 10 ++++ .../src/test/resources/sdwan-vpn-topology.json | 23 +++++++++ 6 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 restapi-call-node/provider/src/test/resources/sdwan-site.json create mode 100644 restapi-call-node/provider/src/test/resources/sdwan-vpn-topology.json (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index e5503435b..9a89af6b5 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -392,6 +392,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { throws SvcLogicException { log.info("Building {} started", format); long t1 = System.currentTimeMillis(); + String originalTemplate = template; template = expandRepeats(ctx, template, 1); @@ -439,7 +440,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } String req = format == Format.XML - ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) : XmlJsonUtil.removeEmptyStructJson(ss.toString()); + ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) : XmlJsonUtil.removeEmptyStructJson(originalTemplate, ss.toString()); if (format == Format.JSON) { req = XmlJsonUtil.removeLastCommaJson(req); diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java index 8a0ca8d94..4712b4298 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -272,7 +272,7 @@ public final class XmlJsonUtil { return sb.toString(); } - public static String removeEmptyStructJson(String s) { + public static String removeEmptyStructJson(String template, String s) { int k = 0; while (k < s.length()) { boolean curly = true; @@ -304,8 +304,13 @@ public final class XmlJsonUtil { if (i5 < 0) i5 = s.length(); - s = s.substring(0, i4) + s.substring(i5); - k = 0; + /*If template mandates empty construct to be present, those should not be removed.*/ + if ((template != null) && template.contains(s.substring(i4))) { + k = i1 + 1; + } else { + s = s.substring(0, i4) + s.substring(i5); + k = 0; + } } else k = i1 + 1; } else diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java index 5c6c4e279..4008c56c7 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java @@ -51,6 +51,61 @@ public class TestRestapiCallNode { rcn.sendRequest(p, ctx); } + @Test + public void testJsonSdwanVpnTopologyTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + ctx.setAttribute("prop.topology", "topoType"); + + ctx.setAttribute("prop.roles_length", "1"); + ctx.setAttribute("prop.roles[0]", "role1"); + + ctx.setAttribute("prop.siteAttachement_length", "2"); + + ctx.setAttribute("prop.siteAttachement[0].siteId", "site1"); + ctx.setAttribute("prop.siteAttachement[0].roles_length", "0"); + ctx.setAttribute("prop.siteAttachement[0].roles[0]", "role1"); + ctx.setAttribute("prop.siteAttachement[0].roles[1]", "role3"); + + ctx.setAttribute("prop.siteAttachement[1].siteId", "site2"); + ctx.setAttribute("prop.siteAttachement[1].roles_length", "1"); + ctx.setAttribute("prop.siteAttachement[1].roles[0]", "role2"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/sdwan-vpn-topology.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonSdwanSiteTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + ctx.setAttribute("prop.name", "site1"); + + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/sdwan-site.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + @Test public void testJsonTemplate() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java index bd9ff1c98..31fa2f9f9 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java @@ -254,7 +254,7 @@ public class TestXmlJsonUtil { "}\r\n" + ""; - String xmlout = XmlJsonUtil.removeEmptyStructJson(xmlin); + String xmlout = XmlJsonUtil.removeEmptyStructJson(null, xmlin); log.info(xmlout); Assert.assertEquals(xmloutexpected, xmlout); diff --git a/restapi-call-node/provider/src/test/resources/sdwan-site.json b/restapi-call-node/provider/src/test/resources/sdwan-site.json new file mode 100644 index 000000000..238ec7642 --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/sdwan-site.json @@ -0,0 +1,10 @@ +{ + "sites": [ + { + "name": ${prop.name}, + "controlPoints": [] + } + ] +} + + diff --git a/restapi-call-node/provider/src/test/resources/sdwan-vpn-topology.json b/restapi-call-node/provider/src/test/resources/sdwan-vpn-topology.json new file mode 100644 index 000000000..4260d2fc1 --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/sdwan-vpn-topology.json @@ -0,0 +1,23 @@ +{ + "vpnId": ${prop.vpn1Id}, + "areas": [ + { + "name": "area1", + "areaType": "leaf", + "topologyType": ${prop.topology}, + "siteAttachements": [${repeat:prop.siteAttachement_length: + { + "siteId": ${prop.siteAttachement[${1}].siteId}, + "role": [${repeat:prop.siteAttachement[${1}].roles_length: + ${prop.siteAttachement[${1}].roles[${2}]}, + } + ], + "workMode": "with-interconnection", + "sitePriority": "active", + "borders": "null" + }, + } + ] + } + ] +} \ No newline at end of file -- cgit 1.2.3-korg From c7971703e0455c2ea71ac1b7072d4d1d2f99577f Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 11 Oct 2018 16:25:06 -0400 Subject: Prepare for RC0 release Update to prepare for RC0 release build: remove -STAGING tag from release version and use released parent poms. Change-Id: I4411cbd86164f0e2739196d78fd1670f92bc1edd Issue-ID: CCSDK-617 Signed-off-by: Timoney, Dan (dt5972) --- features/ccsdk-sli-plugins-all/pom.xml | 2 +- features/features-sli-plugins/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 2 +- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 2 +- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- restconf-client/features/ccsdk-restconf-client/pom.xml | 2 +- restconf-client/features/features-restconf-client/pom.xml | 2 +- restconf-client/features/pom.xml | 2 +- restconf-client/installer/pom.xml | 2 +- restconf-client/pom.xml | 2 +- restconf-client/provider/pom.xml | 2 +- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/pom.xml | 2 +- sshapi-call-node/installer/pom.xml | 2 +- sshapi-call-node/pom.xml | 2 +- sshapi-call-node/provider/pom.xml | 2 +- template-node/features/ccsdk-template-node/pom.xml | 2 +- template-node/features/features-template-node/pom.xml | 2 +- template-node/features/pom.xml | 2 +- template-node/installer/pom.xml | 2 +- template-node/pom.xml | 2 +- template-node/provider/pom.xml | 2 +- version.properties | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index 714ad58a5..65c648ae6 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index b3333b600..66519ef5d 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index c2b77d0fd..d984bd80b 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/features/pom.xml b/features/pom.xml index 257627da4..fae7a0e46 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/pom.xml b/pom.xml index 7a0f84a9f..5cae3e7f8 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 744d6d892..86af69f99 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 0f1b28c88..4d8610c7e 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 32e139b4f..3c6f9b74b 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 0a6918a3e..ea0fd2db1 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 25c2cf225..4cb284bc9 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 7f9352341..5dd1a883e 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 2c616a298..885315131 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 8160611dd..aeb5ad6e1 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 55e0945e7..89458bf9a 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index acb6ae899..97214a702 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index f704647ab..674e5dd21 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 035f2fcf3..bdd980fec 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 462036e73..1c45de213 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 166ddc53d..bd42f8cf0 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index 6aa3fde88..7c0a89ff7 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index fd675c80a..965786427 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index fccd697bb..fbfdf0710 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 43c9d1737..cfa374548 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -6,7 +6,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index 9220b1f78..1cd200c33 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index dc924244a..f566268fb 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 82e69b9b6..1327b7768 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -7,7 +7,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 9d570fd36..86b3cb23b 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 7dda908e5..9f2cb8955 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index e4619ca04..e6787d642 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index b7d329e59..e926a439e 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index 021e5921b..b6cf4cc9c 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1-SNAPSHOT + 1.1.1 diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index c918417ca..9c4cabd3e 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index f588f49ce..fa07539b8 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/template-node/pom.xml b/template-node/pom.xml index c2668f869..40bb39da8 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index fa2ba9d91..a8e1de026 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.1.1-SNAPSHOT + 1.1.1 org.onap.ccsdk.sli.plugins diff --git a/version.properties b/version.properties index 1c849dae1..c5250c6c9 100644 --- a/version.properties +++ b/version.properties @@ -11,6 +11,6 @@ feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version}-STAGING +release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From 5b0d0173096c0ac635b0edef71acb3244386e51a Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 23 Oct 2018 08:46:38 -0400 Subject: Roll to initial Dublin snapshot Roll version to initial Dublin snapshot Change-Id: I48713fcb744f895842a52b2d48ba28cccd06817c Issue-ID: CCSDK-617 Signed-off-by: Timoney, Dan (dt5972) --- features/ccsdk-sli-plugins-all/pom.xml | 4 ++-- features/features-sli-plugins/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 4 ++-- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- restconf-client/features/ccsdk-restconf-client/pom.xml | 4 ++-- restconf-client/features/features-restconf-client/pom.xml | 4 ++-- restconf-client/features/pom.xml | 4 ++-- restconf-client/installer/pom.xml | 4 ++-- restconf-client/pom.xml | 4 ++-- restconf-client/provider/pom.xml | 8 ++++---- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/pom.xml | 4 ++-- sshapi-call-node/installer/pom.xml | 4 ++-- sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/provider/pom.xml | 4 ++-- template-node/features/ccsdk-template-node/pom.xml | 4 ++-- template-node/features/features-template-node/pom.xml | 4 ++-- template-node/features/pom.xml | 4 ++-- template-node/installer/pom.xml | 4 ++-- template-node/pom.xml | 4 ++-- template-node/provider/pom.xml | 4 ++-- version.properties | 6 +++--- 36 files changed, 75 insertions(+), 75 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index 65c648ae6..4d846bd1a 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -7,13 +7,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins-all - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index 66519ef5d..56d724285 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-sli-plugins - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index d984bd80b..ac8f620ba 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -6,13 +6,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-features-installer - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index fae7a0e46..18dbfbfc1 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-feature-aggregator - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: features diff --git a/pom.xml b/pom.xml index 5cae3e7f8..df1644572 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 86af69f99..84709fa4e 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 4d8610c7e..13d056f10 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 3c6f9b74b..c510a3ac3 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index ea0fd2db1..c86901ee4 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 4cb284bc9..0c167730f 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 5dd1a883e..da1ff21ea 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 885315131..80dcc0ac0 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -7,13 +7,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index aeb5ad6e1..d6b4a2635 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 89458bf9a..36f9d28fe 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 97214a702..9bbcf2a08 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 674e5dd21..cdfee6bf4 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index bdd980fec..5423292f1 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 1c45de213..82eba3bd1 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -7,13 +7,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restconf-client - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index bd42f8cf0..910e86574 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-restconf-client - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index 7c0a89ff7..df2abb123 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-features - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 965786427..23306c7cd 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-installer - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index fbfdf0710..4a2609a9b 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index cfa374548..2618b5cca 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-provider - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} @@ -39,7 +39,7 @@ org.onap.ccsdk.sli.plugins properties-node-provider - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT org.opendaylight.yangtools @@ -63,7 +63,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT org.opendaylight.netconf diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index 1cd200c33..cb42fcf18 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -7,13 +7,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sshapi-call-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index f566268fb..482c83f7b 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -7,13 +7,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-sshapi-call-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 1327b7768..25acf571d 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -7,12 +7,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-features - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 86b3cb23b..3adfb69f4 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-installer - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 9f2cb8955..88456c5ed 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index e6787d642..91ecfabca 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-provider - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index e926a439e..f544fb5a1 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-template-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index b6cf4cc9c..7a61f8caa 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-template-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT feature diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 9c4cabd3e..3b9688ed2 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-features - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index fa07539b8..fb1cd1f2f 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-installer - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom diff --git a/template-node/pom.xml b/template-node/pom.xml index 40bb39da8..8cfea743b 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT pom diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index a8e1de026..456cb19c4 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.1.1 + 1.2.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-provider - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT bundle diff --git a/version.properties b/version.properties index c5250c6c9..c8f383798 100644 --- a/version.properties +++ b/version.properties @@ -6,11 +6,11 @@ # Comment release_name=0 -sprint_number=3 -feature_revision=1 +sprint_number=4 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version} +release_version=${base_version}-STAGING snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From 69d612621915cf9793b5e8c5a4e9ec42187a557d Mon Sep 17 00:00:00 2001 From: Vidyashree Rama Date: Thu, 25 Oct 2018 14:50:31 +0530 Subject: Add authorization header in SSE request Add authorization header in SSE request to support https Issue-ID: CCSDK-628 Change-Id: I031cbed94e21e1f6d90bc0b00b2d70905d47bd69 Signed-off-by: Vidyashree Rama --- .../sli/plugins/restapicall/RestapiCallNode.java | 2 +- .../AdditionalHeaderWebTarget.java | 162 +++++++++++++++++++++ .../restconfdiscovery/RestconfDiscoveryNode.java | 75 +++++++++- .../plugins/restconfdiscovery/SseServerMock.java | 2 +- .../TestRestconfDiscoveryNode.java | 21 +++ 5 files changed, 255 insertions(+), 7 deletions(-) create mode 100644 restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/AdditionalHeaderWebTarget.java (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 9a89af6b5..39399a25a 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -543,7 +543,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return addAuthType(c, p); } - protected Client addAuthType(Client client, Parameters p) throws SvcLogicException { + public Client addAuthType(Client client, Parameters p) throws SvcLogicException { if (p.authtype == AuthType.Unspecified) { if (p.restapiUser != null && p.restapiPassword != null) { client.register(HttpAuthenticationFeature.basic(p.restapiUser, p.restapiPassword)); diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/AdditionalHeaderWebTarget.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/AdditionalHeaderWebTarget.java new file mode 100644 index 000000000..1a0ddbc5f --- /dev/null +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/AdditionalHeaderWebTarget.java @@ -0,0 +1,162 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - CCSDK + * ================================================================================ + * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restconfdiscovery; + +import javax.ws.rs.client.Invocation; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Configuration; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.UriBuilder; +import java.net.URI; +import java.util.Map; + +/** + * Adds additional headers for SSE request. + */ +class AdditionalHeaderWebTarget implements WebTarget { + private WebTarget base; + private String token; + + public AdditionalHeaderWebTarget(WebTarget target, String token) { + base = target; + this.token = token; + } + + @Override + public Invocation.Builder request() { + return base.request().header("X-ACCESS-TOKEN", token); + } + + @Override + public Invocation.Builder request(String... acceptedResponseTypes) { + return base.request().header("X-ACCESS-TOKEN", token); + } + + @Override + public Invocation.Builder request(MediaType... acceptedResponseTypes) { + return base.request().header("X-ACCESS-TOKEN", token); + } + + @Override + public Configuration getConfiguration() { + return base.getConfiguration(); + } + + @Override + public URI getUri() { + return base.getUri(); + } + + @Override + public UriBuilder getUriBuilder() { + return base.getUriBuilder(); + } + + @Override + public WebTarget path(String path) { + return base.path(path); + } + + @Override + public WebTarget resolveTemplate(String name, Object value) { + return base.resolveTemplate(name, value); + } + + @Override + public WebTarget resolveTemplate(String name, Object value, boolean encodeSlashInPath) { + return base.resolveTemplate(name, value, encodeSlashInPath); + } + + @Override + public WebTarget resolveTemplateFromEncoded(String name, Object value) { + return base.resolveTemplateFromEncoded(name, value); + } + + @Override + public WebTarget resolveTemplates(Map templateValues) { + return base.resolveTemplates(templateValues); + } + + @Override + public WebTarget resolveTemplates(Map templateValues, boolean encodeSlashInPath) { + return base.resolveTemplates(templateValues, encodeSlashInPath); + } + + @Override + public WebTarget resolveTemplatesFromEncoded(Map templateValues) { + return base.resolveTemplatesFromEncoded(templateValues); + } + + @Override + public WebTarget matrixParam(String name, Object... values) { + return base.matrixParam(name, values); + } + + @Override + public WebTarget queryParam(String name, Object... values) { + return base.queryParam(name, values); + } + + @Override + public WebTarget property(String name, Object value) { + return base.property(name, value); + } + + @Override + public WebTarget register(Class componentClass) { + return base.register(componentClass); + } + + @Override + public WebTarget register(Class componentClass, int priority) { + return base.register(componentClass, priority); + } + + @Override + public WebTarget register(Class componentClass, Class... contracts) { + return base.register(componentClass, contracts); + } + + @Override + public WebTarget register(Class componentClass, Map, Integer> contracts) { + return base.register(componentClass, contracts); + } + + @Override + public WebTarget register(Object component) { + return base.register(component); + } + + @Override + public WebTarget register(Object component, int priority) { + return base.register(component, priority); + } + + @Override + public WebTarget register(Object component, Class... contracts) { + return base.register(component, contracts); + } + + @Override + public WebTarget register(Object component, Map, Integer> contracts) { + return base.register(component, contracts); + } +} diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java index 111d62847..5c7d695d9 100644 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java @@ -24,12 +24,21 @@ import org.glassfish.jersey.media.sse.EventSource; import org.glassfish.jersey.media.sse.SseFeature; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.Parameters; +import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; import org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode; import org.slf4j.Logger; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.WebTarget; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; @@ -115,9 +124,11 @@ public class RestconfDiscoveryNode implements SvcLogicDiscoveryPlugin { class PersistentConnection implements Runnable { private String url; private volatile boolean running = true; + private Map paramMap; - PersistentConnection(String url) { + PersistentConnection(String url, Map paramMap) { this.url = url; + this.paramMap = paramMap; } private void terminate() { @@ -126,15 +137,26 @@ public class RestconfDiscoveryNode implements SvcLogicDiscoveryPlugin { @Override public void run() { - Client client = ClientBuilder.newBuilder() - .register(SseFeature.class).build(); - WebTarget target = client.target(url); + Parameters p; + WebTarget target = null; + try { + RestapiCallNode restapi = restconfApiCallNode.getRestapiCallNode(); + p = restapi.getParameters(paramMap, new Parameters()); + Client client = ignoreSslClient().register(SseFeature.class); + target = restapi.addAuthType(client, p).target(url); + } catch (SvcLogicException e) { + log.error("Exception occured!", e); + Thread.currentThread().interrupt(); + } + + target = addToken(target, paramMap.get("customHttpHeaders")); EventSource eventSource = EventSource.target(target).build(); eventSource.register(new EventHandler(RestconfDiscoveryNode.this)); eventSource.open(); log.info("Connected to SSE source"); while (running) { try { + log.info("SSE state " + eventSource.isOpen()); Thread.sleep(5000); } catch (InterruptedException e) { log.error("Interrupted!", e); @@ -146,6 +168,49 @@ public class RestconfDiscoveryNode implements SvcLogicDiscoveryPlugin { } } + private Client ignoreSslClient() { + SSLContext sslcontext = null; + + try { + sslcontext = SSLContext.getInstance("TLS"); + sslcontext.init(null, new TrustManager[]{new X509TrustManager() { + @Override + public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { + } + + @Override + public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + } }, new java.security.SecureRandom()); + } catch (NoSuchAlgorithmException | KeyManagementException e) { + throw new IllegalStateException(e); + } + + return ClientBuilder.newBuilder().sslContext(sslcontext).hostnameVerifier((s1, s2) -> true).build(); + } + + protected String getTokenId(String customHttpHeaders) { + if (customHttpHeaders.contains("=")) { + String s[] = customHttpHeaders.split("="); + return s[1]; + } + return customHttpHeaders; + } + + protected WebTarget addToken(WebTarget target, String customHttpHeaders) { + if (customHttpHeaders == null) { + return target; + } + + return new AdditionalHeaderWebTarget( + target, getTokenId(customHttpHeaders)); + } + /** * Establishes a persistent between the client and server. * @@ -167,7 +232,7 @@ public class RestconfDiscoveryNode implements SvcLogicDiscoveryPlugin { subscriptionInfoMap.put(id, info); String url = paramMap.get(SSE_URL); - PersistentConnection connection = new PersistentConnection(url); + PersistentConnection connection = new PersistentConnection(url, paramMap); runnableInfo.put(id, connection); executor.execute(connection); } diff --git a/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/SseServerMock.java b/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/SseServerMock.java index 1b234a236..35ac221fb 100644 --- a/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/SseServerMock.java +++ b/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/SseServerMock.java @@ -35,7 +35,7 @@ public class SseServerMock { @Produces(SseFeature.SERVER_SENT_EVENTS) public EventOutput getServerSentEvents() throws IOException { String data = "{" + - "\"ietf-notification:notification\" : {" + + "\"ietf-restconf:notification\" : {" + " \"eventTime\" : \"2017-10-25T08:22:33.44Z\"," + " \"ietf-yang-push:push-change-update\": {" + "\"subscription-id\":\"89\"," + diff --git a/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java b/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java index b2094ca73..af354e9bf 100644 --- a/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java +++ b/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java @@ -57,6 +57,13 @@ public class TestRestconfDiscoveryNode { p.put("sseConnectURL", "http://localhost:8080/events"); p.put("subscriberId", "networkId"); p.put("responsePrefix", "restapi-result"); + p.put("restapiUser", "access"); + p.put("restapiPassword", "abc@123"); + p.put("customHttpHeaders", "X-ACCESS-TOKEN=x-ik2ps4ikvzupbx0486ft" + + "1ebzs7rt85futh9ho6eofy3wjsap7wqktemlqm4bbsmnar3vrtbyrzuk" + + "bv5itd6m1cftldpjarnyle3sdcqq9hftc4lebz464b5ffxmlbvg9"); + p.put("restapiUrl", "https://localhost:8080/restconf/operations/" + + "ietf-subscribed-notifications:establish-subscription"); RestconfDiscoveryNode rdn = new RestconfDiscoveryNode( new RestconfApiCallNode(new RestapiCallNode())); rdn.establishPersistentConnection(p, ctx, "networkId"); @@ -111,4 +118,18 @@ public class TestRestconfDiscoveryNode { assertThat(rdn.getOutputIdentifier("restapi-result", ctx), is("89")); } + + @Test + public void testGetTokenId() { + String customHttpHeaders = "X-ACCESS-TOKEN=x-ik2ps4ikvzupbx0486ft1ebzs7rt85" + + "futh9ho6eofy3wjsap7wqktemlqm4bbsmnar3vrtbyrzukbv5itd6m1cftldpjarny" + + "le3sdcqq9hftc4lebz464b5ffxmlbvg9"; + RestconfDiscoveryNode rdn = new RestconfDiscoveryNode( + new RestconfApiCallNode(new RestapiCallNode())); + + assertThat(rdn.getTokenId(customHttpHeaders), + is("x-ik2ps4ikvzupbx0486ft1ebzs7rt85futh9ho6eofy3wjsap7wqkt" + + "emlqm4bbsmnar3vrtbyrzukbv5itd6m1cftldpjarnyle3sdcqq9h" + + "ftc4lebz464b5ffxmlbvg9")); + } } -- cgit 1.2.3-korg From 01de875afad6920a65b7ee266437595558d41395 Mon Sep 17 00:00:00 2001 From: "shashikanth.vh" Date: Tue, 13 Nov 2018 21:20:31 +0530 Subject: fixed restapicall JsonParser to handle : Fixed Restapicall JsonParser to process ":" if it exist in the response body, this change is required for casablanca too. Change-Id: I83b0769eb13eb8d286cc70adc0e85823d6517dcd Issue-ID: SDNC-519 Signed-off-by: shashikanth.vh --- .../ccsdk/sli/plugins/restapicall/JsonParser.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java index 4a1dfef50..189ddde31 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java @@ -55,12 +55,17 @@ public final class JsonParser { Iterator ii = json.keys(); while (ii.hasNext()) { String key1 = ii.next(); - wm.put(key1, json.get(key1)); + String[] subKey = key1.split(":"); + if (subKey.length == 2) { + wm.put(subKey[1], json.get(key1)); + } else { + wm.put(key1, json.get(key1)); + } } Map mm = new HashMap<>(); - while (!wm.isEmpty()) + while (!wm.isEmpty()) { for (String key : new ArrayList<>(wm.keySet())) { Object o = wm.get(key); wm.remove(key); @@ -74,7 +79,12 @@ public final class JsonParser { Iterator i = jo.keys(); while (i.hasNext()) { String key1 = i.next(); - wm.put(key + "." + key1, jo.get(key1)); + String[] subKey = key1.split(":"); + if (subKey.length == 2) { + wm.put(key + "." + subKey[1], jo.get(key1)); + } else { + wm.put(key + "." + key1, jo.get(key1)); + } } } else if (o instanceof JSONArray) { JSONArray ja = (JSONArray) o; @@ -82,10 +92,12 @@ public final class JsonParser { log.info("Added property: {}_length: {}", key, String.valueOf(ja.length())); - for (int i = 0; i < ja.length(); i++) + for (int i = 0; i < ja.length(); i++) { wm.put(key + '[' + i + ']', ja.get(i)); + } } } + } return mm; } catch (JSONException e) { throw new SvcLogicException("Unable to convert JSON to properties" + e.getLocalizedMessage(), e); -- cgit 1.2.3-korg From 96856ed3a72873c8a2f2e8163a5e8dda60aafa7a Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Wed, 12 Dec 2018 20:21:13 +0530 Subject: Sonar Fix: HttpMethod.java Fixed sonar issues/code-smells across this file. Issue-ID: CCSDK-820 Change-Id: I495f35866607a1403536dfcebc366afd6d7c0ff7 Signed-off-by: Arundathi Patil --- .../org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java index 40dfa3714..b2f618a1c 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,15 +28,15 @@ public enum HttpMethod { public static HttpMethod fromString(String s) { if (s == null) return null; - if (s.equalsIgnoreCase("get")) + if (("get").equalsIgnoreCase(s)) return GET; - if (s.equalsIgnoreCase("post")) + if (("post").equalsIgnoreCase(s)) return POST; - if (s.equalsIgnoreCase("put")) + if (("put").equalsIgnoreCase(s)) return PUT; - if (s.equalsIgnoreCase("delete")) + if (("delete").equalsIgnoreCase(s)) return DELETE; - if (s.equalsIgnoreCase("patch")) + if (("patch").equalsIgnoreCase(s)) return PATCH; throw new IllegalArgumentException("Invalid value for HTTP Method: " + s); } -- cgit 1.2.3-korg From 66c306fc34c622574f89ff753c9489163c74475c Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Wed, 12 Dec 2018 20:47:24 +0530 Subject: Sonar Fix: RetryPolicy.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-821 Change-Id: Ieac7de3d1bb542394bc876406a4ef0055f4c8ea0 Signed-off-by: Arundathi Patil --- .../onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java index 5cee07791..54c86fefc 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +24,12 @@ package org.onap.ccsdk.sli.plugins.restapicall; public class RetryPolicy { private String[] hostnames; - private Integer maximumRetries; + private Integer maximumRetries; + + public RetryPolicy(String[] hostnames, Integer maximumRetries){ + this.hostnames = hostnames; + this.maximumRetries = maximumRetries; + } public Integer getMaximumRetries() { return maximumRetries; @@ -51,10 +57,4 @@ public class RetryPolicy { return hostnames[position]; } - public RetryPolicy(String[] hostnames, Integer maximumRetries){ - this.hostnames = hostnames; - this.maximumRetries = maximumRetries; - } - - } -- cgit 1.2.3-korg From 9be85cf20aa93908596014a988c03446ad3e0dab Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Wed, 12 Dec 2018 22:08:55 +0530 Subject: Sonar Fix: XmlParser.java Fixed sonar issues/code-smells across this file. Issue-ID: CCSDK-822 Change-Id: Icf2de267282ad30b9235c9aa9dadd1761344c1aa Signed-off-by: Arundathi Patil --- .../org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java index 9aede5b7e..cf6af66f2 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,9 +74,8 @@ public final class XmlParser { private Map properties = new HashMap<>(); - public Map getProperties() { - return properties; - } + StringBuilder currentName = new StringBuilder(); + StringBuilder currentValue = new StringBuilder(); public Handler(Set listNameList) { super(); @@ -84,8 +84,9 @@ public final class XmlParser { this.listNameList = new HashSet<>(); } - StringBuilder currentName = new StringBuilder(); - StringBuilder currentValue = new StringBuilder(); + public Map getProperties() { + return properties; + } @Override public void startElement(String uri, String localName, String qName, Attributes attributes) -- cgit 1.2.3-korg From fb7fd136bdbab1799bb932f53feedf349715c39a Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Mon, 17 Dec 2018 17:33:51 +0530 Subject: Sonar Fix: RetryPolicyStore.java Fixed sonar issues/code-smellls across this file Issue-ID: CCSDK-845 Change-Id: I0a4a59ea875739839a692acec7f1feafb013d32e Signed-off-by: Arundathi Patil --- .../onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java index 775137fff..e4ba5fda6 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,11 +28,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class RetryPolicyStore { - private static final Logger log = LoggerFactory.getLogger(RetryPolicyStore.class); - HashMap retryPolicies; public String proxyServers; + public RetryPolicyStore() { + retryPolicies = new HashMap<>(); + } + public String getProxyServers() { return proxyServers; } @@ -42,10 +45,6 @@ public class RetryPolicyStore { RetryPolicy adminPortalRetry = new RetryPolicy(adminServersArray, adminServersArray.length); retryPolicies.put("dme2proxy", adminPortalRetry); } - - public RetryPolicyStore() { - retryPolicies = new HashMap<>(); - } public RetryPolicy getRetryPolicy(String policyName) { return (this.retryPolicies.get(policyName)); -- cgit 1.2.3-korg From aa781c2d2adf9b0c81506dd7de31fa3617c288e1 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 18 Dec 2018 15:39:41 +0530 Subject: Sonar fix: RetryPolicyStroe.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-845 Change-Id: I25e16b7189fd8c063b8d33605dd55094e3ad5877 Signed-off-by: Arundathi Patil --- .../java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java | 3 --- 1 file changed, 3 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java index e4ba5fda6..f68b851d3 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java @@ -24,9 +24,6 @@ package org.onap.ccsdk.sli.plugins.restapicall; import java.util.HashMap; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class RetryPolicyStore { HashMap retryPolicies; public String proxyServers; -- cgit 1.2.3-korg From 565e49329424de19e35a142e54d1ee7f5c7c57ef Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Fri, 28 Dec 2018 23:23:39 +0530 Subject: Sonar Fix: RestapiCallNode.java Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-879 Change-Id: I037ff59f5cb1b6855b62db434236fc2e567608a9 Signed-off-by: Arundathi Patil --- .../sli/plugins/restapicall/RestapiCallNode.java | 55 ++++++++++++---------- 1 file changed, 31 insertions(+), 24 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 39399a25a..83b12c767 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,6 +79,13 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { private String uebServers; private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; + private String responseReceivedMessage = "Response received. Time: {}"; + private String responseHttpCodeMessage = "HTTP response code: {}"; + private String requestPostingException = "Exception while posting http request to client "; + private static String skipSendingMessage = "skipSending"; + private static String responsePrefix = "responsePrefix"; + private static String restapiUrlString = "restapiUrl"; + public RestapiCallNode() { String configDir = System.getProperty(PROPERTIES_DIR_KEY, DEFAULT_PROPERTIES_DIR); @@ -115,7 +123,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.templateFileName = parseParam(paramMap, "templateFileName", false, null); p.requestBody = parseParam(paramMap, "requestBody", false, null); - p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null); + p.restapiUrl = parseParam(paramMap, restapiUrlString, true, null); validateUrl(p.restapiUrl); p.restapiUser = parseParam(paramMap, "restapiUser", false, null); p.restapiPassword = parseParam(paramMap, "restapiPassword", false, @@ -134,9 +142,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { "unspecified")); p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); - p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); + p.responsePrefix = parseParam(paramMap, responsePrefix, false, null); p.listNameList = getListNameList(paramMap); - String skipSendingStr = paramMap.get("skipSending"); + String skipSendingStr = paramMap.get(skipSendingMessage); p.skipSending = "true".equalsIgnoreCase(skipSendingStr); p.convertResponse = valueOf(parseParam(paramMap, "convertResponse", false, "true")); @@ -344,8 +352,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } log.error("Error sending the request: " + e.getMessage(), e); - String prefix = parseParam(paramMap, "responsePrefix", false, null); - if (retryPolicy == null || shouldRetry == false) { + String prefix = parseParam(paramMap, responsePrefix, false, null); + if (retryPolicy == null || !shouldRetry) { setFailureResponseStatus(ctx, prefix, e.getMessage(), r); } else { if (retryCount == null) { @@ -357,13 +365,13 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { try { retryCount = retryCount + 1; if (retryCount < retryPolicy.getMaximumRetries() + 1) { - URI uri = new URI(paramMap.get("restapiUrl")); + URI uri = new URI(paramMap.get(restapiUrlString)); String hostname = uri.getHost(); String retryString = retryPolicy.getNextHostName(uri.toString()); URI uriTwo = new URI(retryString); URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port(uriTwo.getPort()).scheme( uriTwo.getScheme()).build(); - paramMap.put("restapiUrl", retryUri.toString()); + paramMap.put(restapiUrlString, retryUri.toString()); log.debug("URL was set to {}", retryUri.toString()); log.debug("Failed to communicate with host {}. Request will be re-attempted using the host {}.", hostname, retryString); @@ -417,7 +425,6 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { String var1 = template.substring(i1 + 2, i2); String value1 = format == Format.XML ? XmlJsonUtil.getXml(mm, var1) : XmlJsonUtil.getJson(mm, var1); - // log.info(" " + var1 + ": " + value1); if (value1 == null || value1.trim().length() == 0) { // delete the whole element (line) int i3 = template.lastIndexOf('\n', i1); @@ -653,7 +660,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { try { response = invocationBuilder.method(p.httpMethod.toString(), entity(request, tt1)); } catch (ProcessingException | IllegalStateException e) { - throw new SvcLogicException("Exception while posting http request to client " + + throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } @@ -669,8 +676,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } long t2 = System.currentTimeMillis(); - log.info("Response received. Time: {}", (t2 - t1)); - log.info("HTTP response code: {}", r.code); + log.info(responseReceivedMessage, (t2 - t1)); + log.info(responseHttpCodeMessage, r.code); log.info("HTTP response message: {}", r.message); logHeaders(r.headers); log.info("HTTP response: {}", r.body); @@ -731,7 +738,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { r = new HttpResponse(); r.code = 500; r.message = e.getMessage(); - String prefix = parseParam(paramMap, "responsePrefix", false, null); + String prefix = parseParam(paramMap, responsePrefix, false, null); setResponseStatus(ctx, prefix, r); } @@ -747,8 +754,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.user = parseParam(paramMap, "user", false, null); p.password = parseParam(paramMap, "password", false, null); p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); - p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); - String skipSendingStr = paramMap.get("skipSending"); + p.responsePrefix = parseParam(paramMap, responsePrefix, false, null); + String skipSendingStr = paramMap.get(skipSendingMessage); p.skipSending = "true".equalsIgnoreCase(skipSendingStr); p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", false, null); p.oAuthVersion = parseParam(paramMap, "oAuthVersion", false, null); @@ -788,7 +795,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { r = new HttpResponse(); r.code = 500; r.message = e.getMessage(); - String prefix = parseParam(paramMap, "responsePrefix", false, null); + String prefix = parseParam(paramMap, responsePrefix, false, null); setResponseStatus(ctx, prefix, r); } @@ -825,7 +832,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { throw new SvcLogicException("Http operation" + p.httpMethod + "not supported"); } } catch (ProcessingException e) { - throw new SvcLogicException("Exception while posting http request to client " + + throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } @@ -856,7 +863,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { throw new SvcLogicException("Http operation" + p.httpMethod + "not supported"); } } catch (ProcessingException e) { - throw new SvcLogicException("Exception while posting http request to client " + + throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } @@ -872,8 +879,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } long t2 = System.currentTimeMillis(); - log.info("Response received. Time: {}", (t2 - t1)); - log.info("HTTP response code: {}", r.code); + log.info(responseReceivedMessage, (t2 - t1)); + log.info(responseHttpCodeMessage, r.code); log.info("HTTP response message: {}", r.message); logHeaders(r.headers); log.info("HTTP response: {}", r.body); @@ -886,8 +893,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.topic = parseParam(paramMap, "topic", true, null); p.templateFileName = parseParam(paramMap, "templateFileName", false, null); p.rootVarName = parseParam(paramMap, "rootVarName", false, null); - p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null); - String skipSendingStr = paramMap.get("skipSending"); + p.responsePrefix = parseParam(paramMap, responsePrefix, false, null); + String skipSendingStr = paramMap.get(skipSendingMessage); p.skipSending = "true".equalsIgnoreCase(skipSendingStr); return p; } @@ -954,7 +961,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { try { response = invocationBuilder.post(Entity.entity(request, tt1)); } catch (ProcessingException e) { - throw new SvcLogicException("Exception while posting http request to client " + + throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } r.code = response.getStatus(); @@ -965,8 +972,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } long t2 = System.currentTimeMillis(); - log.info("Response received. Time: {}", (t2 - t1)); - log.info("HTTP response code: {}", r.code); + log.info(responseReceivedMessage, (t2 - t1)); + log.info(responseHttpCodeMessage, r.code); logHeaders(r.headers); log.info("HTTP response:\n {}", r.body); -- cgit 1.2.3-korg From 1e3fada75a8990292c71878c13d9f8dd5a7c60f8 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 8 Jan 2019 12:39:26 -0500 Subject: Prepare for release build Prepare for release of early ODL-Oxygen based CCSDK Dublin Change-Id: I2ea09c398025c9578a2da8ff32360be9672292c7 Issue-ID: CCSDK-870 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 204 +++++++++-------- features/features-sli-plugins/pom.xml | 6 +- features/installer/pom.xml | 245 ++++++++++---------- features/pom.xml | 2 +- pom.xml | 2 +- .../features/ccsdk-properties-node/pom.xml | 19 +- .../features/features-properties-node/pom.xml | 46 ++-- properties-node/features/pom.xml | 44 ++-- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 50 ++-- properties-node/provider/pom.xml | 103 ++++----- .../features/ccsdk-restapi-call-node/pom.xml | 112 ++++----- .../features/features-restapi-call-node/pom.xml | 46 ++-- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 252 ++++++++++----------- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 6 +- .../features/ccsdk-restconf-client/pom.xml | 117 +++++----- .../features/features-restconf-client/pom.xml | 46 ++-- restconf-client/features/pom.xml | 2 +- restconf-client/installer/pom.xml | 5 +- restconf-client/pom.xml | 2 +- restconf-client/provider/pom.xml | 6 +- .../features/ccsdk-sshapi-call-node/pom.xml | 12 +- .../features/features-sshapi-call-node/pom.xml | 10 +- sshapi-call-node/features/pom.xml | 6 +- sshapi-call-node/installer/pom.xml | 2 +- sshapi-call-node/pom.xml | 2 +- sshapi-call-node/provider/pom.xml | 3 +- version.properties | 2 +- 30 files changed, 692 insertions(+), 666 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index b8c11c897..8679f7fb0 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -1,106 +1,110 @@ - 4.0.0 + 4.0.0 - org.onap.ccsdk.sli.plugins - sli-plugins-artifacts - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.plugins + sli-plugins-artifacts + 0.4.0-SNAPSHOT + pom - ccsdk-sli-plugins :: sli-plugins-artifacts - CCSDK plugins components Bill of Materials (BOM) - https://wiki.onap.org - - ONAP - - - - org.onap.ccsdk.parent - parent - 1.2.0-SNAPSHOT - - - - - - org.onap.ccsdk.sli.plugins - ccsdk-properties-node - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.plugins - ccsdk-restapi-call-node - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.plugins - ccsdk-restconf-client - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.plugins - ccsdk-template-node - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.plugins - fabric-discovery-plugin-provider - ${project.version} - - - org.onap.ccsdk.sli.plugins - fabric-discovery-plugin-installer - ${project.version} - - - org.onap.ccsdk.sli.plugins - properties-node-provider - ${project.version} - - - org.onap.ccsdk.sli.plugins - properties-node-installer - ${project.version} - - - org.onap.ccsdk.sli.plugins - restapi-call-node-provider - ${project.version} - - - org.onap.ccsdk.sli.plugins - restapi-call-node-installer - ${project.version} - - - org.onap.ccsdk.sli.plugins - restconf-client-provider - ${project.version} - - - org.onap.ccsdk.sli.plugins - restconf-client-installer - ${project.version} - - - org.onap.ccsdk.sli.plugins - template-node-provider - ${project.version} - - - org.onap.ccsdk.sli.plugins - template-node-installer - ${project.version} - - - + ccsdk-sli-plugins :: sli-plugins-artifacts + CCSDK plugins components Bill of Materials (BOM) + https://wiki.onap.org + + ONAP + + + + org.onap.ccsdk.parent + parent + 1.2.0 + + + + ${project.version} + + + + + + org.onap.ccsdk.sli.plugins + ccsdk-properties-node + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.plugins + ccsdk-restapi-call-node + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.plugins + ccsdk-restconf-client + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.plugins + ccsdk-template-node + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.plugins + fabric-discovery-plugin-provider + ${project.version} + + + org.onap.ccsdk.sli.plugins + fabric-discovery-plugin-installer + ${project.version} + + + org.onap.ccsdk.sli.plugins + properties-node-provider + ${project.version} + + + org.onap.ccsdk.sli.plugins + properties-node-installer + ${project.version} + + + org.onap.ccsdk.sli.plugins + restapi-call-node-provider + ${project.version} + + + org.onap.ccsdk.sli.plugins + restapi-call-node-installer + ${project.version} + + + org.onap.ccsdk.sli.plugins + restconf-client-provider + ${project.version} + + + org.onap.ccsdk.sli.plugins + restconf-client-installer + ${project.version} + + + org.onap.ccsdk.sli.plugins + template-node-provider + ${project.version} + + + org.onap.ccsdk.sli.plugins + template-node-installer + ${project.version} + + + diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index 56d724285..ac28d7878 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.0-SNAPSHOT + 1.2.0 @@ -16,6 +16,10 @@ ccsdk-sli-plugins :: features :: ${project.artifactId} + + ${project.version} + + ${project.groupId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index ac8f620ba..222d203d6 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -1,137 +1,136 @@ - - 4.0.0 + + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT - - + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 + + - org.onap.ccsdk.sli.plugins - sliplugins-features-installer - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.plugins + sliplugins-features-installer + 0.4.0-SNAPSHOT + pom - ccsdk-sli-plugins :: features :: ${project.artifactId} + ccsdk-sli-plugins :: features :: ${project.artifactId} - - ccsdk-sli-plugins-all - ${application.name} - mvn:org.onap.ccsdk.sli.plugins/${features.boot}/${project.version}/xml/features - false - + + ccsdk-sli-plugins-all + ${application.name} + mvn:org.onap.ccsdk.sli.plugins/${features.boot}/${project.version}/xml/features + false + - + - - org.onap.ccsdk.sli.plugins - ${application.name} - ${project.version} - xml - features - - - * - * - - - + + org.onap.ccsdk.sli.plugins + ${application.name} + ${project.version} + xml + features + + + * + * + + + - + - - - - maven-assembly-plugin - - - maven-repo-zip - - single - - package - - true - stage/${application.name}-${project.version} - - src/assembly/assemble_mvnrepo_zip.xml - - true - - - - installer-zip - - single - - package - - true - ${application.name}-${project.version}-installer - - src/assembly/assemble_installer_zip.xml - - false - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - - copy-dependencies - - prepare-package - - false - ${project.build.directory}/assembly/system - false - true - true - true - false - false + + + + maven-assembly-plugin + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false org.onap.ccsdk.sli.plugins - provided - - - - - - maven-resources-plugin - 2.6 - - - copy-version - - copy-resources - - validate - - ${basedir}/target/stage - - - src/main/resources/scripts - - install-feature.sh - - true - - - - + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + - - + + - - + + diff --git a/features/pom.xml b/features/pom.xml index 18dbfbfc1..d2e0828e2 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 diff --git a/pom.xml b/pom.xml index 1eb8b8bbf..dbc4c0e36 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 84709fa4e..9e7988e39 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,8 +5,8 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.0-SNAPSHOT - + 1.2.0 + org.onap.ccsdk.sli.plugins @@ -18,10 +18,13 @@ + + ${project.version} + - - - + + + org.opendaylight.mdsal.model mdsal-model-artifacts ${odl.mdsal.model.version} @@ -35,9 +38,9 @@ pom import - - - + + + diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 13d056f10..61365c4fe 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -1,29 +1,33 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - feature-repo-parent - 1.2.0-SNAPSHOT - - + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.0 + + - org.onap.ccsdk.sli.plugins - features-properties-node - 0.4.0-SNAPSHOT - feature + org.onap.ccsdk.sli.plugins + features-properties-node + 0.4.0-SNAPSHOT + feature - ccsdk-sli-plugins :: properties-node :: ${project.artifactId} + ccsdk-sli-plugins :: properties-node :: ${project.artifactId} - - - ${project.groupId} - ccsdk-properties-node - ${project.version} - xml - features - + + ${project.version} + - + + + ${project.groupId} + ccsdk-properties-node + ${project.version} + xml + features + + + diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index c510a3ac3..339e9f7c0 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -1,22 +1,22 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT - - - org.onap.ccsdk.sli.plugins - properties-node-features - 0.4.0-SNAPSHOT - pom - - ccsdk-sli-plugins :: properties-node :: ${project.artifactId} - - - ccsdk-properties-node - features-properties-node - - + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 + + + org.onap.ccsdk.sli.plugins + properties-node-features + 0.4.0-SNAPSHOT + pom + + ccsdk-sli-plugins :: properties-node :: ${project.artifactId} + + + ccsdk-properties-node + features-properties-node + + diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index c86901ee4..5c95c0233 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 0c167730f..ac1b28816 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -1,25 +1,25 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT - - - org.onap.ccsdk.sli.plugins - properties-node - 0.4.0-SNAPSHOT - pom - - ccsdk-sli-plugins :: properties-node - This is an implementation of DG Execute Node that reads property file and - puts the properties in the DG context - - - provider - features - installer - - + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 + + + org.onap.ccsdk.sli.plugins + properties-node + 0.4.0-SNAPSHOT + pom + + ccsdk-sli-plugins :: properties-node + This is an implementation of DG Execute Node that reads property file and + puts the properties in the DG context + + + provider + features + installer + + diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index da1ff21ea..668e1168a 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -1,51 +1,52 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - binding-parent - 1.2.0-SNAPSHOT - - - org.onap.ccsdk.sli.plugins - properties-node-provider - 0.4.0-SNAPSHOT - bundle - - ccsdk-sli-plugins :: properties-node :: ${project.artifactId} - http://maven.apache.org - - - UTF-8 - - - - - junit - junit - test - - - org.springframework - spring-test - test - - - org.onap.ccsdk.sli.core - sli-common - - - org.onap.ccsdk.sli.core - sli-provider - - - org.slf4j - slf4j-api - - - org.codehaus.jettison - jettison - - - + + + 4.0.0 + + + org.onap.ccsdk.parent + binding-parent + 1.2.0 + + + org.onap.ccsdk.sli.plugins + properties-node-provider + 0.4.0-SNAPSHOT + bundle + + ccsdk-sli-plugins :: properties-node :: ${project.artifactId} + http://maven.apache.org + + + UTF-8 + ${project.version} + + + + + junit + junit + test + + + org.springframework + spring-test + test + + + org.onap.ccsdk.sli.core + sli-common + + + org.onap.ccsdk.sli.core + sli-provider + + + org.slf4j + slf4j-api + + + org.codehaus.jettison + jettison + + + diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 80dcc0ac0..6a07d2d99 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -1,57 +1,59 @@ - - 4.0.0 - - - org.onap.ccsdk.parent - single-feature-parent - 1.2.0-SNAPSHOT - - - - org.onap.ccsdk.sli.plugins - ccsdk-restapi-call-node - 0.4.0-SNAPSHOT - feature - - ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - - - - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - - - - - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - - - ${project.groupId} - restapi-call-node-provider - ${project.version} - - + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.2.0 + + + + org.onap.ccsdk.sli.plugins + ccsdk-restapi-call-node + 0.4.0-SNAPSHOT + feature + + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + + + + ${project.version} + + + + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + ${odl.mdsal.model.version} + pom + import + + + org.opendaylight.controller + mdsal-artifacts + ${odl.mdsal.version} + pom + import + + + + + + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + restapi-call-node-provider + ${project.version} + + diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index d6b4a2635..3ca5fa2f3 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -1,29 +1,33 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - feature-repo-parent - 1.2.0-SNAPSHOT - - + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.0 + + - org.onap.ccsdk.sli.plugins - features-restapi-call-node - 0.4.0-SNAPSHOT - feature + org.onap.ccsdk.sli.plugins + features-restapi-call-node + 0.4.0-SNAPSHOT + feature - ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - - - ${project.groupId} - ccsdk-restapi-call-node - ${project.version} - xml - features - + + ${project.version} + - + + + ${project.groupId} + ccsdk-restapi-call-node + ${project.version} + xml + features + + + diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 36f9d28fe..b8351b34b 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 9bbcf2a08..399bcf3f2 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -1,48 +1,48 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0-SNAPSHOT - + + org.onap.ccsdk.parent + odlparent-lite + 1.2.0 + - org.onap.ccsdk.sli.plugins - restapi-call-node-installer - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.plugins + restapi-call-node-installer + 0.4.0-SNAPSHOT + pom - ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - - ccsdk-restapi-call-node - ${application.name} + + ccsdk-restapi-call-node + ${application.name} mvn:org.onap.ccsdk.sli.plugins/${features.boot}/${project.version}/xml/features - false - + false + - + - - org.onap.ccsdk.sli.plugins - ${application.name} - ${project.version} - xml - features - - - * - * - - - + + org.onap.ccsdk.sli.plugins + ${application.name} + ${project.version} + xml + features + + + * + * + + + - - org.onap.ccsdk.sli.plugins - restapi-call-node-provider - ${project.version} - + + org.onap.ccsdk.sli.plugins + restapi-call-node-provider + ${project.version} + org.springframework spring-beans @@ -51,98 +51,98 @@ org.springframework spring-context - + - - - - maven-assembly-plugin - 2.6 - - - maven-repo-zip - - single - - package - - true - stage/${application.name}-${project.version} - - src/assembly/assemble_mvnrepo_zip.xml - - true - - - - installer-zip - - single - - package - - true - ${application.name}-${project.version}-installer - - src/assembly/assemble_installer_zip.xml - - false - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - - copy-dependencies - - prepare-package - - false - ${project.build.directory}/assembly/system - false - true - true - true - false - false - org.onap.ccsdk.sli.core - provided - - - - - - maven-resources-plugin - 2.6 - - - copy-version - - copy-resources - - validate - - ${basedir}/target/stage - - - src/main/resources/scripts - - install-feature.sh - - true - - - - + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli.core + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + - - + + - - + + diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index cdfee6bf4..093497e90 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 5423292f1..74127832e 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent binding-parent - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins @@ -18,6 +17,7 @@ UTF-8 + ${project.version} diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 82eba3bd1..97f36121e 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -1,61 +1,60 @@ - - 4.0.0 - - - org.onap.ccsdk.parent - single-feature-parent - 1.2.0-SNAPSHOT - - - - org.onap.ccsdk.sli.plugins - ccsdk-restconf-client - 0.4.0-SNAPSHOT - feature - - - true - - - ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} - - - - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - - - - - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - - - ${project.groupId} - restconf-client-provider - ${project.version} - - + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.2.0 + + + + org.onap.ccsdk.sli.plugins + ccsdk-restconf-client + 0.4.0-SNAPSHOT + feature + + + true + ${project.version} + + + ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} + + + + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + ${odl.mdsal.model.version} + pom + import + + + org.opendaylight.controller + mdsal-artifacts + ${odl.mdsal.version} + pom + import + + + + + + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + restconf-client-provider + ${project.version} + + diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 910e86574..32c7feb1b 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -1,29 +1,33 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - feature-repo-parent - 1.2.0-SNAPSHOT - - + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.0 + + - org.onap.ccsdk.sli.plugins - features-restconf-client - 0.4.0-SNAPSHOT - feature + org.onap.ccsdk.sli.plugins + features-restconf-client + 0.4.0-SNAPSHOT + feature - ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} + ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} - - - ${project.groupId} - ccsdk-restconf-client - ${project.version} - xml - features - + + ${project.version} + - + + + ${project.groupId} + ccsdk-restconf-client + ${project.version} + xml + features + + + diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index df2abb123..e0595c1fc 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 23306c7cd..cbf003d23 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 4a2609a9b..1097d721e 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 2618b5cca..78bbc1693 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent binding-parent - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins @@ -19,6 +18,7 @@ UTF-8 + ${project.version} diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index cb42fcf18..ead54c77f 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -1,14 +1,12 @@ - + 4.0.0 org.onap.ccsdk.parent single-feature-parent - 1.2.0-SNAPSHOT - + 1.2.0 + org.onap.ccsdk.sli.plugins @@ -20,6 +18,10 @@ + + ${project.version} + + diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 482c83f7b..430a305f5 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -1,13 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent feature-repo-parent - 1.2.0-SNAPSHOT + 1.2.0 @@ -18,6 +16,10 @@ ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} + + ${project.version} + + ${project.groupId} diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 25acf571d..aae34a5ce 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -1,13 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 3adfb69f4..a726f6350 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 88456c5ed..b6167c45b 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 91ecfabca..b25b69e47 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.0-SNAPSHOT + 1.2.0 org.onap.ccsdk.sli.plugins @@ -18,6 +18,7 @@ UTF-8 + ${project.version} diff --git a/version.properties b/version.properties index c8f383798..8c1e34f3b 100644 --- a/version.properties +++ b/version.properties @@ -11,6 +11,6 @@ feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -release_version=${base_version}-STAGING +release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg From 057bc260e7752bc11960cf9cab4005efec1739c7 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 4 Jan 2019 09:22:20 -0500 Subject: Changes for Fluorine Updates to sli/plugins to run in OpenDaylight Fluorine Change-Id: I093a663ff5459df5eacdb632ad3217c322cc9cfa Issue-ID: CCSDK-870 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 204 ++++++++--------- features/ccsdk-sli-plugins-all/pom.xml | 29 +-- features/features-sli-plugins/pom.xml | 8 +- features/installer/pom.xml | 242 ++++++++++---------- features/pom.xml | 4 +- pom.xml | 4 +- .../features/ccsdk-properties-node/pom.xml | 30 +-- .../features/features-properties-node/pom.xml | 46 ++-- properties-node/features/pom.xml | 4 +- properties-node/installer/pom.xml | 4 +- properties-node/pom.xml | 4 +- properties-node/provider/pom.xml | 17 +- .../features/ccsdk-restapi-call-node/pom.xml | 88 +++---- .../features/features-restapi-call-node/pom.xml | 46 ++-- restapi-call-node/features/pom.xml | 4 +- restapi-call-node/installer/pom.xml | 252 ++++++++++----------- restapi-call-node/pom.xml | 4 +- restapi-call-node/provider/pom.xml | 17 +- .../features/ccsdk-restconf-client/pom.xml | 95 ++++---- .../features/features-restconf-client/pom.xml | 46 ++-- restconf-client/features/pom.xml | 4 +- restconf-client/installer/pom.xml | 4 +- restconf-client/pom.xml | 4 +- restconf-client/provider/pom.xml | 27 ++- .../features/ccsdk-sshapi-call-node/pom.xml | 26 +-- .../features/features-sshapi-call-node/pom.xml | 8 +- sshapi-call-node/features/pom.xml | 4 +- sshapi-call-node/installer/pom.xml | 4 +- sshapi-call-node/pom.xml | 4 +- sshapi-call-node/provider/pom.xml | 17 +- template-node/features/ccsdk-template-node/pom.xml | 6 +- .../features/features-template-node/pom.xml | 12 +- template-node/features/pom.xml | 34 ++- template-node/installer/pom.xml | 4 +- template-node/pom.xml | 37 ++- template-node/provider/pom.xml | 16 +- version.properties | 2 +- 37 files changed, 637 insertions(+), 724 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 8679f7fb0..26dbaa59d 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -1,110 +1,106 @@ - 4.0.0 + 4.0.0 - org.onap.ccsdk.sli.plugins - sli-plugins-artifacts - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.plugins + sli-plugins-artifacts + 0.4.1-SNAPSHOT + pom - ccsdk-sli-plugins :: sli-plugins-artifacts - CCSDK plugins components Bill of Materials (BOM) - https://wiki.onap.org - - ONAP - - - - org.onap.ccsdk.parent - parent - 1.2.0 - - - - ${project.version} - - - - - - org.onap.ccsdk.sli.plugins - ccsdk-properties-node - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.plugins - ccsdk-restapi-call-node - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.plugins - ccsdk-restconf-client - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.plugins - ccsdk-template-node - ${project.version} - xml - feature - - - org.onap.ccsdk.sli.plugins - fabric-discovery-plugin-provider - ${project.version} - - - org.onap.ccsdk.sli.plugins - fabric-discovery-plugin-installer - ${project.version} - - - org.onap.ccsdk.sli.plugins - properties-node-provider - ${project.version} - - - org.onap.ccsdk.sli.plugins - properties-node-installer - ${project.version} - - - org.onap.ccsdk.sli.plugins - restapi-call-node-provider - ${project.version} - - - org.onap.ccsdk.sli.plugins - restapi-call-node-installer - ${project.version} - - - org.onap.ccsdk.sli.plugins - restconf-client-provider - ${project.version} - - - org.onap.ccsdk.sli.plugins - restconf-client-installer - ${project.version} - - - org.onap.ccsdk.sli.plugins - template-node-provider - ${project.version} - - - org.onap.ccsdk.sli.plugins - template-node-installer - ${project.version} - - - + ccsdk-sli-plugins :: sli-plugins-artifacts + CCSDK plugins components Bill of Materials (BOM) + https://wiki.onap.org + + ONAP + + + + org.onap.ccsdk.parent + parent + 1.2.1-SNAPSHOT + + + + + + org.onap.ccsdk.sli.plugins + ccsdk-properties-node + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.plugins + ccsdk-restapi-call-node + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.plugins + ccsdk-restconf-client + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.plugins + ccsdk-template-node + ${project.version} + xml + feature + + + org.onap.ccsdk.sli.plugins + fabric-discovery-plugin-provider + ${project.version} + + + org.onap.ccsdk.sli.plugins + fabric-discovery-plugin-installer + ${project.version} + + + org.onap.ccsdk.sli.plugins + properties-node-provider + ${project.version} + + + org.onap.ccsdk.sli.plugins + properties-node-installer + ${project.version} + + + org.onap.ccsdk.sli.plugins + restapi-call-node-provider + ${project.version} + + + org.onap.ccsdk.sli.plugins + restapi-call-node-installer + ${project.version} + + + org.onap.ccsdk.sli.plugins + restconf-client-provider + ${project.version} + + + org.onap.ccsdk.sli.plugins + restconf-client-installer + ${project.version} + + + org.onap.ccsdk.sli.plugins + template-node-provider + ${project.version} + + + org.onap.ccsdk.sli.plugins + template-node-installer + ${project.version} + + + diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index 37692c0de..271cbb186 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -1,43 +1,22 @@ - + 4.0.0 org.onap.ccsdk.parent single-feature-parent - 1.2.0-SNAPSHOT - + 1.2.1-SNAPSHOT + org.onap.ccsdk.sli.plugins ccsdk-sli-plugins-all - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - - ${project.groupId} diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index ac28d7878..eb84c5b93 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,21 +5,17 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-sli-plugins - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} - - ${project.version} - - ${project.groupId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 222d203d6..ad751891f 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -1,136 +1,136 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0 - - + + org.onap.ccsdk.parent + odlparent-lite + 1.2.1-SNAPSHOT + + - org.onap.ccsdk.sli.plugins - sliplugins-features-installer - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.plugins + sliplugins-features-installer + 0.4.1-SNAPSHOT + pom - ccsdk-sli-plugins :: features :: ${project.artifactId} + ccsdk-sli-plugins :: features :: ${project.artifactId} - - ccsdk-sli-plugins-all - ${application.name} - mvn:org.onap.ccsdk.sli.plugins/${features.boot}/${project.version}/xml/features - false - + + ccsdk-sli-plugins-all + ${application.name} + mvn:org.onap.ccsdk.sli.plugins/${features.boot}/${project.version}/xml/features + false + - + - - org.onap.ccsdk.sli.plugins - ${application.name} - ${project.version} - xml - features - - - * - * - - - + + org.onap.ccsdk.sli.plugins + ${application.name} + ${project.version} + xml + features + + + * + * + + + - + - - - - maven-assembly-plugin - - - maven-repo-zip - - single - - package - - true - stage/${application.name}-${project.version} - - src/assembly/assemble_mvnrepo_zip.xml - - true - - - - installer-zip - - single - - package - - true - ${application.name}-${project.version}-installer - - src/assembly/assemble_installer_zip.xml - - false - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - - copy-dependencies - - prepare-package - - false - ${project.build.directory}/assembly/system - false - true - true - true - false - false + + + + maven-assembly-plugin + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false org.onap.ccsdk.sli.plugins - provided - - - - - - maven-resources-plugin - 2.6 - - - copy-version - - copy-resources - - validate - - ${basedir}/target/stage - - - src/main/resources/scripts - - install-feature.sh - - true - - - - + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + - - + + - - + + diff --git a/features/pom.xml b/features/pom.xml index d2e0828e2..07d77718d 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-feature-aggregator - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-plugins :: features diff --git a/pom.xml b/pom.xml index dbc4c0e36..201a59b39 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 9e7988e39..1d5feae6c 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,42 +5,18 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} - - - - ${project.version} - - - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - - + diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 61365c4fe..e00d2cfa4 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -1,33 +1,29 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - feature-repo-parent - 1.2.0 - - + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.1-SNAPSHOT + + - org.onap.ccsdk.sli.plugins - features-properties-node - 0.4.0-SNAPSHOT - feature + org.onap.ccsdk.sli.plugins + features-properties-node + 0.4.1-SNAPSHOT + feature - ccsdk-sli-plugins :: properties-node :: ${project.artifactId} + ccsdk-sli-plugins :: properties-node :: ${project.artifactId} - - ${project.version} - + + + ${project.groupId} + ccsdk-properties-node + ${project.version} + xml + features + - - - ${project.groupId} - ccsdk-properties-node - ${project.version} - xml - features - - - + diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 339e9f7c0..27bea0291 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 5c95c0233..c431b521c 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index ac1b28816..c8d9c9a3c 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 668e1168a..92cff9992 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} @@ -18,8 +18,19 @@ UTF-8 - ${project.version} + + + + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + + diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 6a07d2d99..da6b8d0d2 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -1,59 +1,35 @@ - 4.0.0 - - - org.onap.ccsdk.parent - single-feature-parent - 1.2.0 - - - - org.onap.ccsdk.sli.plugins - ccsdk-restapi-call-node - 0.4.0-SNAPSHOT - feature - - ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - - - - ${project.version} - - - - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - - - - - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - - - ${project.groupId} - restapi-call-node-provider - ${project.version} - - + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.plugins + ccsdk-restapi-call-node + 0.4.1-SNAPSHOT + feature + + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + + + + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + restapi-call-node-provider + ${project.version} + + diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 3ca5fa2f3..64541a74b 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -1,33 +1,29 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - feature-repo-parent - 1.2.0 - - + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.1-SNAPSHOT + + - org.onap.ccsdk.sli.plugins - features-restapi-call-node - 0.4.0-SNAPSHOT - feature + org.onap.ccsdk.sli.plugins + features-restapi-call-node + 0.4.1-SNAPSHOT + feature - ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - - ${project.version} - + + + ${project.groupId} + ccsdk-restapi-call-node + ${project.version} + xml + features + - - - ${project.groupId} - ccsdk-restapi-call-node - ${project.version} - xml - features - - - + diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index b8351b34b..3ae7a2fc3 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 399bcf3f2..1675e4ed7 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -1,48 +1,48 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 1.2.0 - + + org.onap.ccsdk.parent + odlparent-lite + 1.2.1-SNAPSHOT + - org.onap.ccsdk.sli.plugins - restapi-call-node-installer - 0.4.0-SNAPSHOT - pom + org.onap.ccsdk.sli.plugins + restapi-call-node-installer + 0.4.1-SNAPSHOT + pom - ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - - ccsdk-restapi-call-node - ${application.name} + + ccsdk-restapi-call-node + ${application.name} mvn:org.onap.ccsdk.sli.plugins/${features.boot}/${project.version}/xml/features - false - + false + - + - - org.onap.ccsdk.sli.plugins - ${application.name} - ${project.version} - xml - features - - - * - * - - - + + org.onap.ccsdk.sli.plugins + ${application.name} + ${project.version} + xml + features + + + * + * + + + - - org.onap.ccsdk.sli.plugins - restapi-call-node-provider - ${project.version} - + + org.onap.ccsdk.sli.plugins + restapi-call-node-provider + ${project.version} + org.springframework spring-beans @@ -51,98 +51,98 @@ org.springframework spring-context - + - - - - maven-assembly-plugin - 2.6 - - - maven-repo-zip - - single - - package - - true - stage/${application.name}-${project.version} - - src/assembly/assemble_mvnrepo_zip.xml - - true - - - - installer-zip - - single - - package - - true - ${application.name}-${project.version}-installer - - src/assembly/assemble_installer_zip.xml - - false - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - - copy-dependencies - - prepare-package - - false - ${project.build.directory}/assembly/system - false - true - true - true - false - false - org.onap.ccsdk.sli.core - provided - - - - - - maven-resources-plugin - 2.6 - - - copy-version - - copy-resources - - validate - - ${basedir}/target/stage - - - src/main/resources/scripts - - install-feature.sh - - true - - - - + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli.core + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + - - + + - - + + diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 093497e90..de941aadc 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 74127832e..52178540c 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,21 +5,32 @@ org.onap.ccsdk.parent binding-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} UTF-8 - ${project.version} + + + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + + + javax.ws.rs diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 97f36121e..e439eac70 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -1,60 +1,41 @@ - 4.0.0 - - - org.onap.ccsdk.parent - single-feature-parent - 1.2.0 - - - - org.onap.ccsdk.sli.plugins - ccsdk-restconf-client - 0.4.0-SNAPSHOT - feature - - - true - ${project.version} - - - ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} - - - - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - - - - - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - - - ${project.groupId} - restconf-client-provider - ${project.version} - - + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.plugins + ccsdk-restconf-client + 0.4.1-SNAPSHOT + feature + + + true + + + ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} + + + + + + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + ${project.groupId} + restconf-client-provider + ${project.version} + + diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 32c7feb1b..e82e355d8 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -1,33 +1,29 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - feature-repo-parent - 1.2.0 - - + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.1-SNAPSHOT + + - org.onap.ccsdk.sli.plugins - features-restconf-client - 0.4.0-SNAPSHOT - feature + org.onap.ccsdk.sli.plugins + features-restconf-client + 0.4.1-SNAPSHOT + feature - ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} + ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} - - ${project.version} - + + + ${project.groupId} + ccsdk-restconf-client + ${project.version} + xml + features + - - - ${project.groupId} - ccsdk-restconf-client - ${project.version} - xml - features - - - + diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index e0595c1fc..ae25b5d24 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-features - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index cbf003d23..1bab5b3c1 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-installer - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 1097d721e..57fc99f43 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 78bbc1693..e94671902 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-provider - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} @@ -18,8 +18,19 @@ UTF-8 - ${project.version} + + + + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + + @@ -39,7 +50,7 @@ org.onap.ccsdk.sli.plugins properties-node-provider - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT org.opendaylight.yangtools @@ -63,18 +74,22 @@ org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT org.opendaylight.netconf restconf-nb-rfc8040 - ${odl.mdsal.version} org.opendaylight.yangtools yang-parser-impl 2.0.6.1 + + org.osgi + org.osgi.core + provided + diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index ead54c77f..3ac681f85 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,41 +5,19 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.0 + 1.2.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sshapi-call-node - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} - - ${project.version} - - - - - - org.opendaylight.mdsal.model - mdsal-model-artifacts - ${odl.mdsal.model.version} - pom - import - - - org.opendaylight.controller - mdsal-artifacts - ${odl.mdsal.version} - pom - import - - - + ${project.groupId} ccsdk-template-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 52178540c..5b34153d8 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -49,15 +49,20 @@ org.slf4j slf4j-api + + org.glassfish.jersey.bundles.repackaged + jersey-guava + 2.22.2 + org.glassfish.jersey.security oauth1-signature - ${glassfish.version} + ${jersey.version} org.glassfish.jersey.security oauth1-client - ${glassfish.version} + ${jersey.version} org.codehaus.jettison @@ -66,14 +71,10 @@ org.glassfish.jersey.core jersey-client - ${glassfish.version} - - - org.glassfish.jersey.inject - jersey-hk2 - ${glassfish.version} + ${jersey.version} + junit diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index e94671902..0dae6960e 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -36,7 +36,7 @@ org.glassfish.jersey.media jersey-media-sse - ${glassfish.version} + ${jersey.version} javax.ws.rs @@ -103,22 +103,16 @@ ${mockito.version} test - - org.glassfish.jersey.inject - jersey-hk2 - ${glassfish.version} - test - org.glassfish.jersey.containers jersey-container-servlet - ${glassfish.version} + ${jersey.version} test org.glassfish.jersey.containers jersey-container-grizzly2-http - ${glassfish.version} + ${jersey.version} test @@ -133,5 +127,11 @@ 2.0.6.1 test + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + test + -- cgit 1.2.3-korg From 35f6854436afefc3083acd665689b00abd49a060 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Thu, 14 Feb 2019 20:10:03 +0000 Subject: RestApiCallNode header changes allow the http header Accept to be set independently from the http header Content-Type Change-Id: I66fd846cec065a12afe7111c644aa373b61cf424 Issue-ID: CCSDK-1077 Signed-off-by: Smokowski, Kevin (ks6305) --- .../ccsdk/sli/plugins/restapicall/Parameters.java | 1 + .../sli/plugins/restapicall/RestapiCallNode.java | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java index d3fec37ee..8f65cf261 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java @@ -50,4 +50,5 @@ public class Parameters { public String oAuthVersion; public AuthType authtype; public Boolean returnRequestPayload; + public String accept; } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 83b12c767..4c04c9d3b 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -165,6 +165,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { false, null)); p.returnRequestPayload = valueOf(parseParam( paramMap, "returnRequestPayload", false, null)); + p.accept = parseParam(paramMap, "accept", + false, null); return p; } @@ -631,14 +633,16 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { r.code = 200; if (!p.skipSending) { - String tt = p.format == Format.XML ? "application/xml" : "application/json"; - String tt1 = tt + ";charset=UTF-8"; - if (p.contentType != null) { - tt = p.contentType; - tt1 = p.contentType; + String accept = p.accept; + if(accept == null) { + accept = p.format == Format.XML ? "application/xml" : "application/json"; + } + String contentType = p.contentType; + if(contentType == null) { + contentType = accept + ";charset=UTF-8"; } - Invocation.Builder invocationBuilder = webTarget.request(tt1).accept(tt); + Invocation.Builder invocationBuilder = webTarget.request(contentType).accept(accept); if (p.format == Format.NONE) { invocationBuilder.header("", ""); @@ -658,7 +662,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { Response response; try { - response = invocationBuilder.method(p.httpMethod.toString(), entity(request, tt1)); + response = invocationBuilder.method(p.httpMethod.toString(), entity(request, contentType)); } catch (ProcessingException | IllegalStateException e) { throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); @@ -1012,4 +1016,4 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { public String responsePrefix; public boolean skipSending; } -} \ No newline at end of file +} -- cgit 1.2.3-korg From e973a0552cc500d02cec4dcaa6205196ef2193ba Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Tue, 19 Feb 2019 16:05:46 +0000 Subject: dependency cleanup remove sli-provider from template node and restapicallnode Change-Id: I21ffceaf085016b112b3fbe9144870b8d136772f Issue-ID: CCSDK-1093 Signed-off-by: Smokowski, Kevin (ks6305) --- restapi-call-node/provider/pom.xml | 4 ---- template-node/provider/pom.xml | 4 ---- 2 files changed, 8 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 5b34153d8..9f0f1cebf 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -41,10 +41,6 @@ org.onap.ccsdk.sli.core sli-common - - org.onap.ccsdk.sli.core - sli-provider - org.slf4j slf4j-api diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 23eee4d61..7434abc0f 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -37,10 +37,6 @@ org.onap.ccsdk.sli.core sli-common - - org.onap.ccsdk.sli.core - sli-provider - org.slf4j slf4j-api -- cgit 1.2.3-korg From 0320e9c271f8534ce867bd4c36ab1883e55cf6e6 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 14 Mar 2019 12:01:11 -0400 Subject: Prepare for release 0.4.1 Prepare to create release version 0.4.1 by using released version of parent pom Change-Id: I72b174efd82ab09b64e2c4c52225304f8174e07a Issue-ID: CCSDK-1156 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- features/ccsdk-sli-plugins-all/pom.xml | 2 +- features/features-sli-plugins/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 7 +++---- grToolkit/features/features-gr-toolkit/pom.xml | 2 +- grToolkit/features/pom.xml | 2 +- grToolkit/installer/pom.xml | 2 +- grToolkit/model/pom.xml | 2 +- grToolkit/pom.xml | 2 +- grToolkit/provider/pom.xml | 2 +- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 2 +- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 2 +- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- restconf-client/features/ccsdk-restconf-client/pom.xml | 2 +- restconf-client/features/features-restconf-client/pom.xml | 2 +- restconf-client/features/pom.xml | 2 +- restconf-client/installer/pom.xml | 2 +- restconf-client/pom.xml | 2 +- restconf-client/provider/pom.xml | 2 +- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/pom.xml | 2 +- sshapi-call-node/installer/pom.xml | 2 +- sshapi-call-node/pom.xml | 2 +- sshapi-call-node/provider/pom.xml | 2 +- template-node/features/ccsdk-template-node/pom.xml | 6 ++---- template-node/features/features-template-node/pom.xml | 2 +- template-node/features/pom.xml | 2 +- template-node/installer/pom.xml | 6 ++---- template-node/pom.xml | 2 +- template-node/provider/pom.xml | 2 +- 43 files changed, 47 insertions(+), 52 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 26dbaa59d..354e995a0 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index 7d9068e88..b75833c38 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index eb84c5b93..a8e1ec967 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index ad751891f..6459adc78 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/features/pom.xml b/features/pom.xml index 07d77718d..163ec876d 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index f4865a5b3..3b655ce17 100755 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -1,13 +1,12 @@ - + 4.0.0 org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT - + 1.2.1 + org.onap.ccsdk.sli.plugins diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index d74cbb63c..2c966a999 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index 3f6ab6186..cf3886ce0 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index b15c877f7..9e44e8500 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index 348b34784..ade2c6fa2 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index c36e2f161..af3ada398 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index 75b6d431b..6f23f9afa 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 7528a9b78..d21e9eee2 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 1d5feae6c..66b6bb8fc 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index e00d2cfa4..fc01a7491 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 27bea0291..75b7b23fb 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index c431b521c..c06ee8beb 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index c8d9c9a3c..ec1b9980d 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 92cff9992..3b72050db 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 638cff391..cae47c65f 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 64541a74b..f63a296c5 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 3ae7a2fc3..6a2908d1c 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 1675e4ed7..10ce3c2c8 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index de941aadc..42b9ea98a 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 9f0f1cebf..fa69f5d0e 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index e439eac70..1255149b8 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index e82e355d8..41c10f0ce 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index ae25b5d24..3e07de3e1 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 1bab5b3c1..b3f61302d 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 57fc99f43..c5b753048 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 0dae6960e..ccc9ab869 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index 3ac681f85..7ec23e9cf 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 69273c34e..f0752ffeb 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index fae9df428..e9931fe77 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 7e703a7aa..169c4d481 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index cc3187bc4..4c866fdf9 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 6dff42fb6..cad9b796f 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index e43381f39..4ce8a7d9b 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -1,13 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent single-feature-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index 0e22b6137..6b2f28993 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index a7a2d67d7..a43a8f142 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index d8cdd69b3..f00714780 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -1,13 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/template-node/pom.xml b/template-node/pom.xml index 3bfe36279..d7277910a 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 7434abc0f..38921305d 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1-SNAPSHOT + 1.2.1 org.onap.ccsdk.sli.plugins -- cgit 1.2.3-korg From 38147a9470892ef00182b58f48fd661032ce8a11 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 19 Mar 2019 18:08:37 -0400 Subject: Compile against Fluorine SR2 Updated to compile against Fluorine SR2 Change-Id: I83208310f6386ac8c37433ac8af50de7c611fd06 Issue-ID: CCSDK-1156 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- features/ccsdk-sli-plugins-all/pom.xml | 2 +- features/features-sli-plugins/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 2 +- grToolkit/features/features-gr-toolkit/pom.xml | 2 +- grToolkit/features/pom.xml | 2 +- grToolkit/installer/pom.xml | 2 +- grToolkit/model/pom.xml | 2 +- grToolkit/pom.xml | 2 +- grToolkit/provider/pom.xml | 2 +- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 2 +- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 2 +- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- restconf-client/features/ccsdk-restconf-client/pom.xml | 2 +- restconf-client/features/features-restconf-client/pom.xml | 2 +- restconf-client/features/pom.xml | 2 +- restconf-client/installer/pom.xml | 2 +- restconf-client/pom.xml | 2 +- restconf-client/provider/pom.xml | 2 +- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/pom.xml | 2 +- sshapi-call-node/installer/pom.xml | 2 +- sshapi-call-node/pom.xml | 2 +- sshapi-call-node/provider/pom.xml | 2 +- template-node/features/ccsdk-template-node/pom.xml | 2 +- template-node/features/features-template-node/pom.xml | 2 +- template-node/features/pom.xml | 2 +- template-node/installer/pom.xml | 2 +- template-node/pom.xml | 2 +- template-node/provider/pom.xml | 2 +- version.properties | 2 +- 44 files changed, 44 insertions(+), 44 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 354e995a0..79ad7574d 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index b75833c38..c7a43a483 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index a8e1ec967..3d6364689 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 6459adc78..a83003c7c 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/features/pom.xml b/features/pom.xml index 163ec876d..4e8783475 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index 3b655ce17..9c3a54a37 100755 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index 2c966a999..abde024b4 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index cf3886ce0..cd8f272cf 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 9e44e8500..71b097999 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index ade2c6fa2..1012e762b 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index af3ada398..cf754dac5 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index 6f23f9afa..cc4354b33 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 2cd2337e7..cdc24e08d 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 66b6bb8fc..d30ee0ad3 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index fc01a7491..faea526e8 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 75b7b23fb..a1f58ab1f 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index c06ee8beb..dae92c36c 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index ec1b9980d..b3ecbc6e1 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 3b72050db..e05a2b185 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index cae47c65f..1200f92ce 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index f63a296c5..04645ee77 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 6a2908d1c..d5967d591 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 10ce3c2c8..187ed18d2 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 42b9ea98a..e2167ec4a 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index fa69f5d0e..aa183c58b 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 1255149b8..52c766d7a 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 41c10f0ce..8757bec22 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index 3e07de3e1..2471ece18 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index b3f61302d..32901f88b 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index c5b753048..cb63a81a9 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index ccc9ab869..1e6bfcc8e 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index 7ec23e9cf..b6534393f 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index f0752ffeb..f0a3e8041 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index e9931fe77..c04ad6095 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 169c4d481..6b54e409a 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 4c866fdf9..48adb81ba 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index cad9b796f..c3b7c281a 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index 4ce8a7d9b..b6cf31f2d 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index 6b2f28993..0e1f5ec39 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.1 + 1.2.2-SNAPSHOT diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index a43a8f142..1e0fdb12e 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index f00714780..26c745acc 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/template-node/pom.xml b/template-node/pom.xml index d7277910a..719e97576 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 38921305d..fc714240f 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.1 + 1.2.2-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/version.properties b/version.properties index 6086d3c9f..80a47aef7 100644 --- a/version.properties +++ b/version.properties @@ -7,7 +7,7 @@ release_name=0 sprint_number=4 -feature_revision=1 +feature_revision=2 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From d9080716861ba46ea86fc7aebd4d4c42eea97016 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 22 Mar 2019 09:37:52 -0400 Subject: Roll version to 0.4.2-SNAPSHOT Roll version of ccsdk/sli/plugins to next snapshot version Change-Id: I142e7b2ec5e72e318007c329640f1818255c60f4 Issue-ID: CCSDK-1156 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- features/ccsdk-sli-plugins-all/pom.xml | 2 +- features/features-sli-plugins/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 2 +- grToolkit/features/features-gr-toolkit/pom.xml | 2 +- grToolkit/features/pom.xml | 2 +- grToolkit/installer/pom.xml | 2 +- grToolkit/model/pom.xml | 2 +- grToolkit/pom.xml | 2 +- grToolkit/provider/pom.xml | 2 +- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 2 +- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 2 +- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- restconf-client/features/ccsdk-restconf-client/pom.xml | 2 +- restconf-client/features/features-restconf-client/pom.xml | 2 +- restconf-client/features/pom.xml | 2 +- restconf-client/installer/pom.xml | 2 +- restconf-client/pom.xml | 2 +- restconf-client/provider/pom.xml | 6 +++--- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/pom.xml | 2 +- sshapi-call-node/installer/pom.xml | 2 +- sshapi-call-node/pom.xml | 2 +- sshapi-call-node/provider/pom.xml | 2 +- template-node/features/ccsdk-template-node/pom.xml | 2 +- template-node/features/features-template-node/pom.xml | 2 +- template-node/features/pom.xml | 2 +- template-node/installer/pom.xml | 2 +- template-node/pom.xml | 2 +- template-node/provider/pom.xml | 2 +- 43 files changed, 45 insertions(+), 45 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 79ad7574d..911a1d6ab 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.plugins sli-plugins-artifacts - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: sli-plugins-artifacts diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index c7a43a483..0cd756eda 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins ccsdk-sli-plugins-all - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index 3d6364689..aff865f0a 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins features-sli-plugins - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index a83003c7c..ed909fc22 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins sliplugins-features-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 4e8783475..efd6cbe68 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins sliplugins-feature-aggregator - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: features diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index 9c3a54a37..264ad7cf6 100755 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins ccsdk-gr-toolkit - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index abde024b4..db2887436 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins features-gr-toolkit - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index cd8f272cf..c092a4b80 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -11,7 +11,7 @@ ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} gr-toolkit-features org.onap.ccsdk.sli.plugins - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 71b097999..5d1743389 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -11,7 +11,7 @@ ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-gr-toolkit diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index 1012e762b..c917c4567 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -10,7 +10,7 @@ ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-model - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index cf754dac5..d2d79c706 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins gr-toolkit - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: gr-toolkit diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index cc4354b33..951d2da60 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -10,7 +10,7 @@ ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle diff --git a/pom.xml b/pom.xml index cdc24e08d..9e564d5e8 100755 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index d30ee0ad3..6412ca3ae 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index faea526e8..1f2da265c 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins features-properties-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index a1f58ab1f..23bfd53e2 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins properties-node-features - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index dae92c36c..d37160912 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins properties-node-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index b3ecbc6e1..7ff022582 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins properties-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index e05a2b185..532d5f7b9 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins properties-node-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 1200f92ce..a28cbbe4c 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 04645ee77..23b8f84b5 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index d5967d591..8ca913bb8 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 187ed18d2..cbc4a6ec1 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index e2167ec4a..7cdee7c50 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index aa183c58b..1d724c646 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 52c766d7a..56fa2ebaf 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins ccsdk-restconf-client - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 8757bec22..56846fb45 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins features-restconf-client - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index 2471ece18..5a882ebcd 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins restconf-client-features - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 32901f88b..4a454b14a 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins restconf-client-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index cb63a81a9..7f2e9c825 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins restconf-client - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 1e6bfcc8e..0d5ee180a 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins restconf-client-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} @@ -50,7 +50,7 @@ org.onap.ccsdk.sli.plugins properties-node-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT org.opendaylight.yangtools @@ -74,7 +74,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT org.opendaylight.netconf diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index b6534393f..ee153ad4e 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins ccsdk-sshapi-call-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index f0a3e8041..421cbbaa7 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins features-sshapi-call-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index c04ad6095..cd045fde3 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins sshapi-call-node-features - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 6b54e409a..39c01db1b 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins sshapi-call-node-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 48adb81ba..6583e69bf 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins sshapi-call-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index c3b7c281a..bdf471b25 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins sshapi-call-node-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index b6cf31f2d..c5152dbc4 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins ccsdk-template-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index 0e1f5ec39..dd9c8992f 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -11,7 +11,7 @@ org.onap.ccsdk.sli.plugins features-template-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT feature diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 1e0fdb12e..b498051f6 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins template-node-features - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index 26c745acc..44425d1e8 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins template-node-installer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/pom.xml b/template-node/pom.xml index 719e97576..c0843b787 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins template-node - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT pom diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index fc714240f..d52587922 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -10,7 +10,7 @@ org.onap.ccsdk.sli.plugins template-node-provider - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT bundle ccsdk-sli-plugins :: template-node :: ${project.artifactId} -- cgit 1.2.3-korg From 2d465026f1ef738b1f4e0274c8608317c57bbdf5 Mon Sep 17 00:00:00 2001 From: janani b Date: Thu, 21 Mar 2019 22:56:13 +0530 Subject: Plugin points to 2.0.1 javax version RestapiCallNode and RestconfClient in plugins will point to the odl default javax version. Also RestconfClient is added to plugins-all features. Issue-ID: CCSDK-1045 Change-Id: I6f7173ec765bc21201f17a3bfd6801c18de610a9 Signed-off-by: janani b --- features/ccsdk-sli-plugins-all/pom.xml | 9 +++++++++ restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 1 - restapi-call-node/provider/pom.xml | 1 - restconf-client/provider/pom.xml | 1 - 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index b75833c38..3d5129b37 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -34,6 +34,14 @@ features + + ${project.groupId} + ccsdk-restconf-client + ${project.version} + xml + features + + ${project.groupId} ccsdk-template-node @@ -41,6 +49,7 @@ xml features + ${project.groupId} ccsdk-sshapi-call-node diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index cae47c65f..c9c08d669 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -21,7 +21,6 @@ javax.ws.rs javax.ws.rs-api - 2.1 org.onap.ccsdk.sli.core diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index fa69f5d0e..b927b4fc5 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -35,7 +35,6 @@ javax.ws.rs javax.ws.rs-api - 2.1 org.onap.ccsdk.sli.core diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index ccc9ab869..7cb2993c1 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -41,7 +41,6 @@ javax.ws.rs javax.ws.rs-api - 2.1 org.onap.ccsdk.sli.core -- cgit 1.2.3-korg From f360b7b2bc9ed8d321dade9cadafe2ebda4f46ab Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Tue, 2 Apr 2019 13:38:06 +0000 Subject: RestApiCallNode HTTP method patch not working RestApiCallNode patch not working after upgrading from sun jersey to glassfish, apply workaround Change-Id: I3a36b9c0c8b241b46059edec08fb80087e67fd93 Issue-ID: CCSDK-1191 Signed-off-by: Smokowski, Kevin (ks6305) --- .../java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 4c04c9d3b..521c66cb3 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -58,6 +58,7 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; import org.apache.commons.lang3.StringUtils; import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.glassfish.jersey.client.oauth1.ConsumerCredentials; import org.glassfish.jersey.client.oauth1.OAuth1ClientSupport; @@ -622,6 +623,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { .build(); } client.property(ClientProperties.CONNECT_TIMEOUT, 5000); + // Needed to support additional HTTP methods such as PATCH + client.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); WebTarget webTarget = addAuthType(client, p).target(p.restapiUrl); -- cgit 1.2.3-korg From 2f860ff302a9583a49a08524a5fcdd7435ee2359 Mon Sep 17 00:00:00 2001 From: Vidyashree Rama Date: Fri, 12 Apr 2019 15:21:56 +0530 Subject: Invalid package name for restapicallnode test Invalid package name for restapicallnode test Issue-ID: CCSDK-1218 Change-Id: Ie0275fa333183dc017c1cf0cc65a4cad87b226f0 Signed-off-by: Vidyashree Rama --- .../sli/plugins/restapicall/TestJsonParser.java | 73 +++ .../plugins/restapicall/TestRestapiCallNode.java | 630 +++++++++++++++++++++ .../sli/plugins/restapicall/TestXmlJsonUtil.java | 262 +++++++++ .../sli/plugins/restapicall/TestXmlParser.java | 121 ++++ .../sli/plugins/sshapicall/TestJsonParser.java | 73 --- .../plugins/sshapicall/TestRestapiCallNode.java | 630 --------------------- .../sli/plugins/sshapicall/TestXmlJsonUtil.java | 262 --------- .../sli/plugins/sshapicall/TestXmlParser.java | 121 ---- .../sli/plugins/restapicall/TestJsonParser.java | 85 +++ .../plugins/restapicall/TestSshApiCallNode.java | 330 +++++++++++ .../sli/plugins/restapicall/TestXmlJsonUtil.java | 264 +++++++++ .../sli/plugins/restapicall/TestXmlParser.java | 123 ++++ .../sli/plugins/sshapicall/TestJsonParser.java | 85 --- .../sli/plugins/sshapicall/TestSshApiCallNode.java | 335 ----------- .../sli/plugins/sshapicall/TestXmlJsonUtil.java | 264 --------- .../sli/plugins/sshapicall/TestXmlParser.java | 123 ---- 16 files changed, 1888 insertions(+), 1893 deletions(-) create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java create mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java create mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestSshApiCallNode.java create mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java create mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java delete mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java delete mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestSshApiCallNode.java delete mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java delete mode 100644 sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java new file mode 100644 index 000000000..5526be81f --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.JsonParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestJsonParser { + + private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); + + @Test + public void test() throws SvcLogicException, IOException { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Map mm = JsonParser.convertToProperties(b.toString()); + + logProperties(mm); + + in.close(); + } + + @Test(expected = NullPointerException.class) + public void testNullString() throws SvcLogicException { + JsonParser.convertToProperties(null); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + log.info("Properties:"); + for (String name : ll) + log.info("--- {}: {}", name, mm.get(name)); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java new file mode 100644 index 000000000..fd982d76e --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -0,0 +1,630 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestRestapiCallNode { + + private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); + + + @Test + public void testDelete() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonSdwanVpnTopologyTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + ctx.setAttribute("prop.topology", "topoType"); + + ctx.setAttribute("prop.roles_length", "1"); + ctx.setAttribute("prop.roles[0]", "role1"); + + ctx.setAttribute("prop.siteAttachement_length", "2"); + + ctx.setAttribute("prop.siteAttachement[0].siteId", "site1"); + ctx.setAttribute("prop.siteAttachement[0].roles_length", "0"); + ctx.setAttribute("prop.siteAttachement[0].roles[0]", "role1"); + ctx.setAttribute("prop.siteAttachement[0].roles[1]", "role3"); + + ctx.setAttribute("prop.siteAttachement[1].siteId", "site2"); + ctx.setAttribute("prop.siteAttachement[1].roles_length", "1"); + ctx.setAttribute("prop.siteAttachement[1].roles[0]", "role2"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/sdwan-vpn-topology.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonSdwanSiteTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + ctx.setAttribute("prop.name", "site1"); + + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/sdwan-site.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testInvalidRepeatTimes() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "a"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidTemplatePath() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resourcess/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testWithoutSkipSending() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + + @Test(expected = SvcLogicException.class) + public void testWithInvalidURI() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo. getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testVpnJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testSiteJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + ctx.setAttribute("prop.l3vpn.site1_name", "10000000-0000-0000-0000-000000000002"); + ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); + ctx.setAttribute("prop.l3vpn.entry1-id", "1"); + ctx.setAttribute("prop.l3vpn.sna1_name", "10000000-0000-0000-0000-000000000004"); + ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); + ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b"); + ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1"); + ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2"); + ctx.setAttribute("prop.l3vpn.sna1_svlan", "100"); + ctx.setAttribute("prop.l3vpn.ac1_protocol", "static"); + ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24"); + ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4"); + + ctx.setAttribute("prop.l3vpn.site2_name", "10000000-0000-0000-0000-000000000005"); + ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); + ctx.setAttribute("prop.l3vpn.entry2-id", "1"); + ctx.setAttribute("prop.l3vpn.sna2_name", "10000000-0000-0000-0000-000000000007"); + ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); + ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c"); + ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.6"); + ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5"); + ctx.setAttribute("prop.l3vpn.sna2_svlan", "200"); + ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp"); + ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.7"); + ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smsitetemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testVrfJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.vrf1-id", "10000000-0000-0000-0000-000000000007"); + ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); + ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); + ctx.setAttribute("prop.l3vpn.vrf2-id", "10000000-0000-0000-0000-000000000009"); + ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); + ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smvrftemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vrf-attributes"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteVpnJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap(); + //p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services" + + "/vpnservice=10000000-0000-0000-0000-000000000001"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "delete"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testL2DciTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.dci-connects.id", "Id1"); + ctx.setAttribute("prop.dci-connects.name", "Name1"); + ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); + ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); + ctx.setAttribute("prop.dci-connects.vni", "1"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l2-dci-connects-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testL3DciTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.dci-connects.id", "Id1"); + ctx.setAttribute("prop.dci-connects.name", "Name1"); + ctx.setAttribute("prop.dci-connects.local_networks_length", "2"); + ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); + ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); + ctx.setAttribute("prop.dci-connects.vni", "1"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3-dci-connects-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + + } + + @Test + public void testControllerTokenTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.user", "admin"); + ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.password", "admin123"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/actokentemplate.json"); + p.put("restapiUrl", "https://ipwan:18002/controller/v2/tokens"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + + @Test + public void testDeleteNoneAsContentType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testPostNoneAsContentType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "none"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteOAuthType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "basic"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeDigest() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "digest"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "oauth"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeNoneOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + @Test + public void testDeleteAuthTypeNoneBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "oauth"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "basic"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeDigest() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "digest"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java new file mode 100644 index 000000000..11eeba7f0 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java @@ -0,0 +1,262 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; +import org.onap.ccsdk.sli.plugins.restapicall.XmlJsonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class TestXmlJsonUtil { + + private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); + + @Test + public void test() { + Map mm = new HashMap<>(); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); + mm.put("service-data.service-information.service-instance-id", "someinstance001"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3_length", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf_length", "1"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", + "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); + + mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); + mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); + mm.put("service-data.vnf-config-information.vendor", "Netconf"); + + mm.put("service-data.vnf-config-information.escape-test", + "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); + + String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); + log.info(ss); + + ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + } + + @Test + public void testRemoveEmptyStructXml() { + String xmlin = "" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmloutexpected = "" + + "\n" + + " \n" + + " blah\n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } + + @Test + public void testRemoveEmptyStructJson() { + String xmlin = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T3\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T4\":{\r\n" + + " \"T12\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T13\":[ ],\r\n" + + " \"T14\":{\r\n" + + " \"T15\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T16\":{\r\n" + + " \r\n" + + " }\r\n" + + " }\r\n" + + " },\r\n" + + " \"T5\":{\r\n" + + " \"T6\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T7\":[\r\n" + + " \"T8\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T9\":{ },\r\n" + + " \"T10\":\"blah\",\r\n" + + " \"T11\":[\r\n" + + " \r\n" + + " ]\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmloutexpected = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T5\":{\r\n" + + " \"T7\":[\r\n" + + " \"T10\":\"blah\",\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmlout = XmlJsonUtil.removeEmptyStructJson(null, xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java new file mode 100644 index 000000000..c6bf4a8b9 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java @@ -0,0 +1,121 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestXmlParser { + + private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); + + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("project.dependencies.dependency"); + listNameList.add("project.build.plugins.plugin"); + listNameList.add("project.build.plugins.plugin.executions.execution"); + listNameList.add("project.build.pluginManagement.plugins.plugin"); + listNameList.add("project.build.pluginManagement." + + "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + + @Test + public void testValidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport[5]"), is("SET_RESET_LP")); + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport[0]"), is("SET_BVOIP_IN")); + + logProperties(mm); + in.close(); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("invalidlength.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java deleted file mode 100644 index 0216b6675..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java +++ /dev/null @@ -1,73 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.sshapicall; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.restapicall.JsonParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestJsonParser { - - private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); - - @Test - public void test() throws SvcLogicException, IOException { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Map mm = JsonParser.convertToProperties(b.toString()); - - logProperties(mm); - - in.close(); - } - - @Test(expected = NullPointerException.class) - public void testNullString() throws SvcLogicException { - JsonParser.convertToProperties(null); - } - - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - log.info("Properties:"); - for (String name : ll) - log.info("--- {}: {}", name, mm.get(name)); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java deleted file mode 100644 index 4008c56c7..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestRestapiCallNode.java +++ /dev/null @@ -1,630 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.sshapicall; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestRestapiCallNode { - - private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); - - - @Test - public void testDelete() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "pwd1"); - p.put("httpMethod", "delete"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testJsonSdwanVpnTopologyTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - ctx.setAttribute("prop.topology", "topoType"); - - ctx.setAttribute("prop.roles_length", "1"); - ctx.setAttribute("prop.roles[0]", "role1"); - - ctx.setAttribute("prop.siteAttachement_length", "2"); - - ctx.setAttribute("prop.siteAttachement[0].siteId", "site1"); - ctx.setAttribute("prop.siteAttachement[0].roles_length", "0"); - ctx.setAttribute("prop.siteAttachement[0].roles[0]", "role1"); - ctx.setAttribute("prop.siteAttachement[0].roles[1]", "role3"); - - ctx.setAttribute("prop.siteAttachement[1].siteId", "site2"); - ctx.setAttribute("prop.siteAttachement[1].roles_length", "1"); - ctx.setAttribute("prop.siteAttachement[1].roles[0]", "role2"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/sdwan-vpn-topology.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testJsonSdwanSiteTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - ctx.setAttribute("prop.name", "site1"); - - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/sdwan-site.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testInvalidRepeatTimes() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "a"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidTemplatePath() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resourcess/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testWithoutSkipSending() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "false"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - - @Test(expected = SvcLogicException.class) - public void testWithInvalidURI() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo. getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "false"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testVpnJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testSiteJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - ctx.setAttribute("prop.l3vpn.site1_name", "10000000-0000-0000-0000-000000000002"); - ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); - ctx.setAttribute("prop.l3vpn.entry1-id", "1"); - ctx.setAttribute("prop.l3vpn.sna1_name", "10000000-0000-0000-0000-000000000004"); - ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); - ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b"); - ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1"); - ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2"); - ctx.setAttribute("prop.l3vpn.sna1_svlan", "100"); - ctx.setAttribute("prop.l3vpn.ac1_protocol", "static"); - ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24"); - ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4"); - - ctx.setAttribute("prop.l3vpn.site2_name", "10000000-0000-0000-0000-000000000005"); - ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); - ctx.setAttribute("prop.l3vpn.entry2-id", "1"); - ctx.setAttribute("prop.l3vpn.sna2_name", "10000000-0000-0000-0000-000000000007"); - ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); - ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c"); - ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.6"); - ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5"); - ctx.setAttribute("prop.l3vpn.sna2_svlan", "200"); - ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp"); - ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.7"); - ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l3smsitetemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testVrfJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.vrf1-id", "10000000-0000-0000-0000-000000000007"); - ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); - ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); - ctx.setAttribute("prop.l3vpn.vrf2-id", "10000000-0000-0000-0000-000000000009"); - ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); - ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l3smvrftemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vrf-attributes"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteVpnJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - Map p = new HashMap(); - //p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services" - + "/vpnservice=10000000-0000-0000-0000-000000000001"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "delete"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testL2DciTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.dci-connects.id", "Id1"); - ctx.setAttribute("prop.dci-connects.name", "Name1"); - ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); - ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); - ctx.setAttribute("prop.dci-connects.vni", "1"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l2-dci-connects-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testL3DciTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.dci-connects.id", "Id1"); - ctx.setAttribute("prop.dci-connects.name", "Name1"); - ctx.setAttribute("prop.dci-connects.local_networks_length", "2"); - ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); - ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); - ctx.setAttribute("prop.dci-connects.vni", "1"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l3-dci-connects-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - - } - - @Test - public void testControllerTokenTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.user", "admin"); - ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.password", "admin123"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/actokentemplate.json"); - p.put("restapiUrl", "https://ipwan:18002/controller/v2/tokens"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - - @Test - public void testDeleteNoneAsContentType() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "pwd1"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testPostNoneAsContentType() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - Map p = new HashMap(); - p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "none"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteOAuthType() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "basic"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeDigest() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "digest"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "oauth"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeNoneOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - @Test - public void testDeleteAuthTypeNoneBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "oauth"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "basic"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeDigest() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "digest"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java deleted file mode 100644 index 31fa2f9f9..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java +++ /dev/null @@ -1,262 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.sshapicall; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.Assert; -import org.junit.Test; -import org.onap.ccsdk.sli.plugins.restapicall.XmlJsonUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class TestXmlJsonUtil { - - private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); - - @Test - public void test() { - Map mm = new HashMap<>(); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); - mm.put("service-data.service-information.service-instance-id", "someinstance001"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3_length", "2"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf_length", "1"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", - "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); - - mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); - mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); - mm.put("service-data.vnf-config-information.vendor", "Netconf"); - - mm.put("service-data.vnf-config-information.escape-test", - "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); - - String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); - log.info(ss); - - ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address"); - log.info(ss); - } - - @Test - public void testRemoveEmptyStructXml() { - String xmlin = "" + - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " blah\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " blah blah\n" + - "\n"; - - String xmloutexpected = "" + - "\n" + - " \n" + - " blah\n" + - " \n" + - " blah blah\n" + - "\n"; - - String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); - log.info(xmlout); - - Assert.assertEquals(xmloutexpected, xmlout); - } - - @Test - public void testRemoveEmptyStructJson() { - String xmlin = "{\r\n" + - " \"T1\":{\r\n" + - " \"T2\":{\r\n" + - " \"T3\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T4\":{\r\n" + - " \"T12\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T13\":[ ],\r\n" + - " \"T14\":{\r\n" + - " \"T15\":{\r\n" + - " \r\n" + - " },\r\n" + - " \"T16\":{\r\n" + - " \r\n" + - " }\r\n" + - " }\r\n" + - " },\r\n" + - " \"T5\":{\r\n" + - " \"T6\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T7\":[\r\n" + - " \"T8\":{\r\n" + - " \r\n" + - " },\r\n" + - " \"T9\":{ },\r\n" + - " \"T10\":\"blah\",\r\n" + - " \"T11\":[\r\n" + - " \r\n" + - " ]\r\n" + - " ]\r\n" + - " }\r\n" + - " }\r\n" + - " }\r\n" + - "}\r\n" + - ""; - - String xmloutexpected = "{\r\n" + - " \"T1\":{\r\n" + - " \"T2\":{\r\n" + - " \"T5\":{\r\n" + - " \"T7\":[\r\n" + - " \"T10\":\"blah\",\r\n" + - " ]\r\n" + - " }\r\n" + - " }\r\n" + - " }\r\n" + - "}\r\n" + - ""; - - String xmlout = XmlJsonUtil.removeEmptyStructJson(null, xmlin); - log.info(xmlout); - - Assert.assertEquals(xmloutexpected, xmlout); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java deleted file mode 100644 index 8ff0b0a3f..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java +++ /dev/null @@ -1,121 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.sshapicall; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.restapicall.XmlParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestXmlParser { - - private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); - - @Test - public void test() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("project.dependencies.dependency"); - listNameList.add("project.build.plugins.plugin"); - listNameList.add("project.build.plugins.plugin.executions.execution"); - listNameList.add("project.build.pluginManagement.plugins.plugin"); - listNameList.add("project.build.pluginManagement." + - "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - logProperties(mm); - in.close(); - } - - @Test - public void testValidLength() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - - assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport[5]"), is("SET_RESET_LP")); - assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport[0]"), is("SET_BVOIP_IN")); - - logProperties(mm); - in.close(); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidLength() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("invalidlength.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - logProperties(mm); - in.close(); - } - - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - log.info("Properties:"); - for (String name : ll) - log.info("--- " + name + ": " + mm.get(name)); - } -} diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java new file mode 100644 index 000000000..78f20e327 --- /dev/null +++ b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.codehaus.jettison.json.JSONException; +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.sshapicall.model.JsonParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestJsonParser { + + private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); + + @Test + public void test() throws SvcLogicException, IOException { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + Map mm = null; + try { + mm = JsonParser.convertToProperties(b.toString()); + } catch (JSONException e){ + throw new SvcLogicException(e.getMessage()); + } + + logProperties(mm); + + in.close(); + } + + @Test(expected = NullPointerException.class) + public void testNullString() throws SvcLogicException { + Map mm = null; + try { + mm = JsonParser.convertToProperties(null); + } catch (JSONException e){ + throw new SvcLogicException(e.getMessage()); + } + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + log.info("Properties:"); + for (String name : ll) + log.info("--- {}: {}", name, mm.get(name)); + } +} diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestSshApiCallNode.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestSshApiCallNode.java new file mode 100644 index 000000000..c0bcdb82a --- /dev/null +++ b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestSshApiCallNode.java @@ -0,0 +1,330 @@ +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.sshapicall.SshApiCallNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; + +import static org.junit.Assert.assertEquals; + +public class TestSshApiCallNode { + + private static final Logger log = LoggerFactory.getLogger(TestSshApiCallNode.class); + + private SshApiCallNode adapter; + private String TestId; + private boolean testMode = true; + private Map params; + private SvcLogicContext svcContext; + + + @Before + public void setup() throws IllegalArgumentException { + testMode = true; + svcContext = new SvcLogicContext(); + adapter = new SshApiCallNode(); + + params = new HashMap<>(); + params.put("AgentUrl", "https://192.168.1.1"); + params.put("User", "test"); + params.put("Password", "test"); + } + + @After + public void tearDown() { + testMode = false; + adapter = null; + params = null; + svcContext = null; + } + + @Test(expected = SvcLogicException.class) + public void testExecCommand_noUrlFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("HostName", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Test", "fail"); + adapter.execCommand(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandPty_noUrlFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("HostName", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Test", "fail"); + adapter.execCommandWithPty(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandResponse_noUrlFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("HostName", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Test", "fail"); + adapter.execWithStatusCheck(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommand_noPortFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Test", "fail"); + adapter.execCommand(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandPty_noPortFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Test", "fail"); + adapter.execCommandWithPty(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandResponse_noPortFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Test", "fail"); + adapter.execWithStatusCheck(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommand_noCmdFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + adapter.execCommand(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandPty_noCmdFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + adapter.execCommandWithPty(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandResponse_noCmdFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + adapter.execWithStatusCheck(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandResponse_noSSHBasicFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("AuthType", "basic"); + params.put("Cmd", "test"); + adapter.execWithStatusCheck(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandResponse_noSSHKeyFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("AuthType", "key"); + params.put("Cmd", "test"); + adapter.execWithStatusCheck(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandResponse_noSSHNoneFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("AuthType", "none"); + params.put("Cmd", "test"); + params.put("ResponseType", "xml"); + adapter.execWithStatusCheck(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandResponse_noSSHFailed() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Cmd", "test"); + params.put("ResponseType", "json"); + adapter.execWithStatusCheck(params, svcContext); + } + + @Test(expected = IllegalArgumentException.class) + public void testExecCommandResponse_noSSHInvalidParam() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Cmd", "test"); + params.put("ResponseType", "txt"); + adapter.execWithStatusCheck(params, svcContext); + } + + @Test(expected = IllegalArgumentException.class) + public void testExecCommandResponse_noSSHInvalidAuthParam() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Cmd", "test"); + params.put("AuthType", "spring"); + params.put("ResponseType", "json"); + adapter.execWithStatusCheck(params, svcContext); + } + + @Test + public void testExecCommandResponse_validJSON() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Cmd", "test"); + params.put("AuthType", "basic"); + params.put("ResponseType", "json"); + params.put("TestOut", "{\"equipment-data\":\"boo\"}"); + params.put("TestFail", "false"); + adapter = new SshApiCallNode(true); + adapter.execWithStatusCheck(params, svcContext); + assertEquals("boo", svcContext.getAttribute("equipment-data")); + } + + @Test + public void testExecCommandResponse_validXML() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Cmd", "test"); + params.put("AuthType", "basic"); + params.put("ResponseType", "xml"); + params.put("TestOut", "4.0.0"); + params.put("TestFail", "false"); + adapter = new SshApiCallNode(true); + adapter.execWithStatusCheck(params, svcContext); + assertEquals("4.0.0", svcContext.getAttribute("modelVersion")); + } + + @Test + public void testExecCommandResponse_validJSONPrefix() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Cmd", "test"); + params.put("AuthType", "basic"); + params.put("ResponseType", "json"); + params.put("TestOut", "{\"equipment-data\":\"boo\"}"); + params.put("ResponsePrefix", "test"); + params.put("TestFail", "false"); + adapter = new SshApiCallNode(true); + adapter.execWithStatusCheck(params, svcContext); + assertEquals("boo", svcContext.getAttribute("test.equipment-data")); + } + + @Test + public void testExecCommandResponse_validXMLPrefix() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Cmd", "test"); + params.put("AuthType", "basic"); + params.put("ResponseType", "xml"); + params.put("TestOut", "4.0.0"); + params.put("ResponsePrefix", "test"); + params.put("TestFail", "false"); + adapter = new SshApiCallNode(true); + adapter.execWithStatusCheck(params, svcContext); + assertEquals("4.0.0", svcContext.getAttribute("test.modelVersion")); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandResponse_validXMLFail() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + + params.put("Url", "test"); + params.put("Port", "10"); + params.put("User", "test"); + params.put("Password", "test"); + params.put("Cmd", "test"); + params.put("AuthType", "basic"); + params.put("ResponseType", "xml"); + params.put("TestOut", "4.0.0"); + params.put("TestFail", "true"); + params.put("ResponsePrefix", "test"); + adapter = new SshApiCallNode(true); + adapter.execWithStatusCheck(params, svcContext); + } + + @Test(expected = SvcLogicException.class) + public void testExecCommandResponse_validXMLPrefixKey() throws SvcLogicException, + IllegalStateException, IllegalArgumentException { + params = new HashMap<>(); + params.put("Url", "test"); + params.put("Port", "10"); + params.put("SshKey", "test"); + params.put("Cmd", "test"); + params.put("ResponseType", "xml"); + params.put("TestOut", "4.0.0"); + params.put("ResponsePrefix", "test"); + adapter.execWithStatusCheck(params, svcContext); + assertEquals("4.0.0", svcContext.getAttribute("test.modelVersion")); + } +} diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java new file mode 100644 index 000000000..33e0f24dd --- /dev/null +++ b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java @@ -0,0 +1,264 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; +import org.onap.ccsdk.sli.plugins.sshapicall.model.XmlJsonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class TestXmlJsonUtil { + + private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); + + @Test + public void test() { + Map mm = new HashMap<>(); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); + mm.put("service-data.service-information.service-instance-id", "someinstance001"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3_length", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf_length", "1"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", + "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); + + mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); + mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); + mm.put("service-data.vnf-config-information.vendor", "Netconf"); + + mm.put("service-data.vnf-config-information.escape-test", + "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); + + String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); + log.info(ss); + + ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + } + + @Test + public void testRemoveEmptyStructXml() { + String xmlin = "" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmloutexpected = "" + + "\n" + + " \n" + + " blah\n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } + + @Test + public void testRemoveEmptyStructJson() { + String xmlin = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T3\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T4\":{\r\n" + + " \"T12\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T13\":[ ],\r\n" + + " \"T14\":{\r\n" + + " \"T15\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T16\":{\r\n" + + " \r\n" + + " }\r\n" + + " }\r\n" + + " },\r\n" + + " \"T5\":{\r\n" + + " \"T6\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T7\":[\r\n" + + " \"T8\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T9\":{ },\r\n" + + " \"T10\":\"blah\",\r\n" + + " \"T11\":[\r\n" + + " \r\n" + + " ]\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmloutexpected = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T5\":{\r\n" + + " \"T7\":[\r\n" + + " \"T10\":\"blah\",\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmlout = XmlJsonUtil.removeEmptyStructJson(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } +} diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java new file mode 100644 index 000000000..ba0ae41de --- /dev/null +++ b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java @@ -0,0 +1,123 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.sshapicall.model.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestXmlParser { + + private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); + + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("project.dependencies.dependency"); + listNameList.add("project.build.plugins.plugin"); + listNameList.add("project.build.plugins.plugin.executions.execution"); + listNameList.add("project.build.pluginManagement.plugins.plugin"); + listNameList.add("project.build.pluginManagement." + + "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + + @Test + public void testValidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport[5]"), is("SET_RESET_LP")); + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport[0]"), is("SET_BVOIP_IN")); + + logProperties(mm); + in.close(); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("invalidlength.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } +} diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java deleted file mode 100644 index 4a5b765a8..000000000 --- a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2018 Samsung Electronics. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.sshapicall; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.codehaus.jettison.json.JSONException; -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.sshapicall.model.JsonParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestJsonParser { - - private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); - - @Test - public void test() throws SvcLogicException, IOException { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - Map mm = null; - try { - mm = JsonParser.convertToProperties(b.toString()); - } catch (JSONException e){ - throw new SvcLogicException(e.getMessage()); - } - - logProperties(mm); - - in.close(); - } - - @Test(expected = NullPointerException.class) - public void testNullString() throws SvcLogicException { - Map mm = null; - try { - mm = JsonParser.convertToProperties(null); - } catch (JSONException e){ - throw new SvcLogicException(e.getMessage()); - } - } - - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - log.info("Properties:"); - for (String name : ll) - log.info("--- {}: {}", name, mm.get(name)); - } -} diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestSshApiCallNode.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestSshApiCallNode.java deleted file mode 100644 index 544057a6e..000000000 --- a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestSshApiCallNode.java +++ /dev/null @@ -1,335 +0,0 @@ -package jtest.org.onap.ccsdk.sli.plugins.sshapicall; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.sshapicall.SshApiCallNode; -import org.onap.ccsdk.sli.plugins.sshapicall.model.XmlParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import static org.junit.Assert.assertEquals; - -public class TestSshApiCallNode { - - private static final Logger log = LoggerFactory.getLogger(TestSshApiCallNode.class); - - private SshApiCallNode adapter; - private String TestId; - private boolean testMode = true; - private Map params; - private SvcLogicContext svcContext; - - - @Before - public void setup() throws IllegalArgumentException { - testMode = true; - svcContext = new SvcLogicContext(); - adapter = new SshApiCallNode(); - - params = new HashMap<>(); - params.put("AgentUrl", "https://192.168.1.1"); - params.put("User", "test"); - params.put("Password", "test"); - } - - @After - public void tearDown() { - testMode = false; - adapter = null; - params = null; - svcContext = null; - } - - @Test(expected = SvcLogicException.class) - public void testExecCommand_noUrlFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("HostName", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Test", "fail"); - adapter.execCommand(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandPty_noUrlFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("HostName", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Test", "fail"); - adapter.execCommandWithPty(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandResponse_noUrlFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("HostName", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Test", "fail"); - adapter.execWithStatusCheck(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommand_noPortFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Test", "fail"); - adapter.execCommand(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandPty_noPortFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Test", "fail"); - adapter.execCommandWithPty(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandResponse_noPortFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Test", "fail"); - adapter.execWithStatusCheck(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommand_noCmdFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - adapter.execCommand(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandPty_noCmdFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - adapter.execCommandWithPty(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandResponse_noCmdFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - adapter.execWithStatusCheck(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandResponse_noSSHBasicFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("AuthType", "basic"); - params.put("Cmd", "test"); - adapter.execWithStatusCheck(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandResponse_noSSHKeyFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("AuthType", "key"); - params.put("Cmd", "test"); - adapter.execWithStatusCheck(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandResponse_noSSHNoneFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("AuthType", "none"); - params.put("Cmd", "test"); - params.put("ResponseType", "xml"); - adapter.execWithStatusCheck(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandResponse_noSSHFailed() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Cmd", "test"); - params.put("ResponseType", "json"); - adapter.execWithStatusCheck(params, svcContext); - } - - @Test(expected = IllegalArgumentException.class) - public void testExecCommandResponse_noSSHInvalidParam() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Cmd", "test"); - params.put("ResponseType", "txt"); - adapter.execWithStatusCheck(params, svcContext); - } - - @Test(expected = IllegalArgumentException.class) - public void testExecCommandResponse_noSSHInvalidAuthParam() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Cmd", "test"); - params.put("AuthType", "spring"); - params.put("ResponseType", "json"); - adapter.execWithStatusCheck(params, svcContext); - } - - @Test - public void testExecCommandResponse_validJSON() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Cmd", "test"); - params.put("AuthType", "basic"); - params.put("ResponseType", "json"); - params.put("TestOut", "{\"equipment-data\":\"boo\"}"); - params.put("TestFail", "false"); - adapter = new SshApiCallNode(true); - adapter.execWithStatusCheck(params, svcContext); - assertEquals("boo", svcContext.getAttribute("equipment-data")); - } - - @Test - public void testExecCommandResponse_validXML() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Cmd", "test"); - params.put("AuthType", "basic"); - params.put("ResponseType", "xml"); - params.put("TestOut", "4.0.0"); - params.put("TestFail", "false"); - adapter = new SshApiCallNode(true); - adapter.execWithStatusCheck(params, svcContext); - assertEquals("4.0.0", svcContext.getAttribute("modelVersion")); - } - - @Test - public void testExecCommandResponse_validJSONPrefix() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Cmd", "test"); - params.put("AuthType", "basic"); - params.put("ResponseType", "json"); - params.put("TestOut", "{\"equipment-data\":\"boo\"}"); - params.put("ResponsePrefix", "test"); - params.put("TestFail", "false"); - adapter = new SshApiCallNode(true); - adapter.execWithStatusCheck(params, svcContext); - assertEquals("boo", svcContext.getAttribute("test.equipment-data")); - } - - @Test - public void testExecCommandResponse_validXMLPrefix() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Cmd", "test"); - params.put("AuthType", "basic"); - params.put("ResponseType", "xml"); - params.put("TestOut", "4.0.0"); - params.put("ResponsePrefix", "test"); - params.put("TestFail", "false"); - adapter = new SshApiCallNode(true); - adapter.execWithStatusCheck(params, svcContext); - assertEquals("4.0.0", svcContext.getAttribute("test.modelVersion")); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandResponse_validXMLFail() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - - params.put("Url", "test"); - params.put("Port", "10"); - params.put("User", "test"); - params.put("Password", "test"); - params.put("Cmd", "test"); - params.put("AuthType", "basic"); - params.put("ResponseType", "xml"); - params.put("TestOut", "4.0.0"); - params.put("TestFail", "true"); - params.put("ResponsePrefix", "test"); - adapter = new SshApiCallNode(true); - adapter.execWithStatusCheck(params, svcContext); - } - - @Test(expected = SvcLogicException.class) - public void testExecCommandResponse_validXMLPrefixKey() throws SvcLogicException, - IllegalStateException, IllegalArgumentException { - params = new HashMap<>(); - params.put("Url", "test"); - params.put("Port", "10"); - params.put("SshKey", "test"); - params.put("Cmd", "test"); - params.put("ResponseType", "xml"); - params.put("TestOut", "4.0.0"); - params.put("ResponsePrefix", "test"); - adapter.execWithStatusCheck(params, svcContext); - assertEquals("4.0.0", svcContext.getAttribute("test.modelVersion")); - } -} diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java deleted file mode 100644 index 218ad6a8d..000000000 --- a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlJsonUtil.java +++ /dev/null @@ -1,264 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2018 Samsung Electronics. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.sshapicall; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.Assert; -import org.junit.Test; -import org.onap.ccsdk.sli.plugins.sshapicall.model.XmlJsonUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class TestXmlJsonUtil { - - private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); - - @Test - public void test() { - Map mm = new HashMap<>(); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); - mm.put("service-data.service-information.service-instance-id", "someinstance001"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3_length", "2"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf_length", "1"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", - "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); - - mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); - mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); - mm.put("service-data.vnf-config-information.vendor", "Netconf"); - - mm.put("service-data.vnf-config-information.escape-test", - "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); - - String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); - log.info(ss); - - ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address"); - log.info(ss); - } - - @Test - public void testRemoveEmptyStructXml() { - String xmlin = "" + - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " blah\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " blah blah\n" + - "\n"; - - String xmloutexpected = "" + - "\n" + - " \n" + - " blah\n" + - " \n" + - " blah blah\n" + - "\n"; - - String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); - log.info(xmlout); - - Assert.assertEquals(xmloutexpected, xmlout); - } - - @Test - public void testRemoveEmptyStructJson() { - String xmlin = "{\r\n" + - " \"T1\":{\r\n" + - " \"T2\":{\r\n" + - " \"T3\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T4\":{\r\n" + - " \"T12\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T13\":[ ],\r\n" + - " \"T14\":{\r\n" + - " \"T15\":{\r\n" + - " \r\n" + - " },\r\n" + - " \"T16\":{\r\n" + - " \r\n" + - " }\r\n" + - " }\r\n" + - " },\r\n" + - " \"T5\":{\r\n" + - " \"T6\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T7\":[\r\n" + - " \"T8\":{\r\n" + - " \r\n" + - " },\r\n" + - " \"T9\":{ },\r\n" + - " \"T10\":\"blah\",\r\n" + - " \"T11\":[\r\n" + - " \r\n" + - " ]\r\n" + - " ]\r\n" + - " }\r\n" + - " }\r\n" + - " }\r\n" + - "}\r\n" + - ""; - - String xmloutexpected = "{\r\n" + - " \"T1\":{\r\n" + - " \"T2\":{\r\n" + - " \"T5\":{\r\n" + - " \"T7\":[\r\n" + - " \"T10\":\"blah\",\r\n" + - " ]\r\n" + - " }\r\n" + - " }\r\n" + - " }\r\n" + - "}\r\n" + - ""; - - String xmlout = XmlJsonUtil.removeEmptyStructJson(xmlin); - log.info(xmlout); - - Assert.assertEquals(xmloutexpected, xmlout); - } -} diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java deleted file mode 100644 index 3f8d37163..000000000 --- a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestXmlParser.java +++ /dev/null @@ -1,123 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2018 Samsung Electronics. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.sshapicall; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.sshapicall.model.XmlParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestXmlParser { - - private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); - - @Test - public void test() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("project.dependencies.dependency"); - listNameList.add("project.build.plugins.plugin"); - listNameList.add("project.build.plugins.plugin.executions.execution"); - listNameList.add("project.build.pluginManagement.plugins.plugin"); - listNameList.add("project.build.pluginManagement." + - "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - logProperties(mm); - in.close(); - } - - @Test - public void testValidLength() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - - assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport[5]"), is("SET_RESET_LP")); - assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport[0]"), is("SET_BVOIP_IN")); - - logProperties(mm); - in.close(); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidLength() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("invalidlength.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - logProperties(mm); - in.close(); - } - - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - log.info("Properties:"); - for (String name : ll) - log.info("--- " + name + ": " + mm.get(name)); - } -} -- cgit 1.2.3-korg From e4c9cfddd142785d527f29ff5c2b5883cc255033 Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Fri, 12 Apr 2019 10:08:20 +0530 Subject: Add support for multi part form data Add support for multipart form data in CCSDK Change-Id: Iacc35efe28b9d91afcfc1e87e0faf41fc74d5c8a Issue-ID: CCSDK-239 Signed-off-by: Gaurav Agrawal --- restapi-call-node/provider/pom.xml | 6 +- .../ccsdk/sli/plugins/restapicall/Parameters.java | 2 + .../sli/plugins/restapicall/RestapiCallNode.java | 86 ++++++++++++++++++---- .../plugins/restapicall/TestRestapiCallNode.java | 27 +++++++ 4 files changed, 105 insertions(+), 16 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index c5556011a..2455866a4 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -68,7 +68,11 @@ jersey-client ${jersey.version} - + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey.version} + diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java index 8f65cf261..aeb07c4d6 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java @@ -51,4 +51,6 @@ public class Parameters { public AuthType authtype; public Boolean returnRequestPayload; public String accept; + public boolean multipartFormData; + public String multipartFile; } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 521c66cb3..a7235fcb5 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -26,6 +26,7 @@ import static java.lang.Boolean.valueOf; import static javax.ws.rs.client.Entity.entity; import static org.onap.ccsdk.sli.plugins.restapicall.AuthType.fromString; +import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.SocketException; @@ -51,17 +52,17 @@ import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; import javax.ws.rs.client.Invocation; import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.EntityTag; -import javax.ws.rs.core.Feature; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; +import javax.ws.rs.core.*; + import org.apache.commons.lang3.StringUtils; import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.glassfish.jersey.client.oauth1.ConsumerCredentials; import org.glassfish.jersey.client.oauth1.OAuth1ClientSupport; +import org.glassfish.jersey.media.multipart.MultiPart; +import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; @@ -168,6 +169,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { paramMap, "returnRequestPayload", false, null)); p.accept = parseParam(paramMap, "accept", false, null); + p.multipartFormData = valueOf(parseParam(paramMap, "multipartFormData", + false, "false")); + p.multipartFile = parseParam(paramMap, "multipartFile", + false, null); return p; } @@ -635,15 +640,17 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { HttpResponse r = new HttpResponse(); r.code = 200; - if (!p.skipSending) { - String accept = p.accept; - if(accept == null) { - accept = p.format == Format.XML ? "application/xml" : "application/json"; - } - String contentType = p.contentType; - if(contentType == null) { - contentType = accept + ";charset=UTF-8"; - } + String accept = p.accept; + if(accept == null) { + accept = p.format == Format.XML ? "application/xml" : "application/json"; + } + + String contentType = p.contentType; + if(contentType == null) { + contentType = accept + ";charset=UTF-8"; + } + + if (!p.skipSending && !p.multipartFormData) { Invocation.Builder invocationBuilder = webTarget.request(contentType).accept(accept); @@ -680,6 +687,55 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (response.hasEntity() && r.code != 204) { r.body = response.readEntity(String.class); } + } else if (!p.skipSending && p.multipartFormData) { + + WebTarget wt = client.register(MultiPartFeature.class).target(p.restapiUrl); + + MultiPart multiPart = new MultiPart(); + multiPart.setMediaType(MediaType.MULTIPART_FORM_DATA_TYPE); + + FileDataBodyPart fileDataBodyPart = new FileDataBodyPart("file", + new File(p.multipartFile), + MediaType.APPLICATION_OCTET_STREAM_TYPE); + multiPart.bodyPart(fileDataBodyPart); + + + Invocation.Builder invocationBuilder = wt.request(contentType).accept(accept); + + if (p.format == Format.NONE) { + invocationBuilder.header("", ""); + } + + if (p.customHttpHeaders != null && p.customHttpHeaders.length() > 0) { + String[] keyValuePairs = p.customHttpHeaders.split(","); + for (String singlePair : keyValuePairs) { + int equalPosition = singlePair.indexOf('='); + invocationBuilder.header(singlePair.substring(0, equalPosition), + singlePair.substring(equalPosition + 1, singlePair.length())); + } + } + + invocationBuilder.header("X-ECOMP-RequestID", org.slf4j.MDC.get("X-ECOMP-RequestID")); + + Response response; + + try { + response = invocationBuilder.method(p.httpMethod.toString(), entity(multiPart, multiPart.getMediaType())); + } catch (ProcessingException | IllegalStateException e) { + throw new SvcLogicException(requestPostingException + + e.getLocalizedMessage(), e); + } + + r.code = response.getStatus(); + r.headers = response.getStringHeaders(); + EntityTag etag = response.getEntityTag(); + if (etag != null) { + r.message = etag.getValue(); + } + if (response.hasEntity() && r.code != 204) { + r.body = response.readEntity(String.class); + } + } long t2 = System.currentTimeMillis(); @@ -858,7 +914,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { log.info("Got response code 301. Sending same request to URL: {}", newUrl); - webTarget = client.target(newUrl); + webTarget = client.target(newUrl); invocationBuilder = webTarget.request(tt).accept(tt); try { diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index fd982d76e..5b047e4e7 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -224,6 +224,33 @@ public class TestRestapiCallNode { rcn.sendRequest(p, ctx); } + @Test(expected = SvcLogicException.class) + public void testFormData() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + p.put("multipartFormData", "true"); + p.put("multipartFile", "src/test/resources/test-template.json"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } @Test(expected = SvcLogicException.class) public void testWithInvalidURI() throws SvcLogicException { -- cgit 1.2.3-korg From a5fa2ea36c115aba01eb3328fd95a12dd654ed00 Mon Sep 17 00:00:00 2001 From: Vidyashree Rama Date: Fri, 12 Apr 2019 14:21:37 +0530 Subject: Add test case for multi part form data Add test case for multipart form data in restapicallnode Issue-ID: CCSDK-239 Change-Id: Icad15bce57455ed2c1cbf4779cf8b0820fa24dc9 Signed-off-by: Vidyashree Rama --- restapi-call-node/provider/pom.xml | 12 ++++++ .../plugins/restapicall/MultipartServerMock.java | 44 ++++++++++++++++++++++ .../plugins/restapicall/TestRestapiCallNode.java | 27 +++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 2455866a4..1f698eade 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -80,5 +80,17 @@ junit test + + org.glassfish.jersey.containers + jersey-container-servlet + ${jersey.version} + test + + + org.glassfish.jersey.containers + jersey-container-grizzly2-http + ${jersey.version} + test + diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java new file mode 100644 index 000000000..9646272b4 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - CCSDK + * ================================================================================ + * Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.ws.rs.Consumes; + +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.io.InputStream; + +@Path("file-upload") +public class MultipartServerMock { + + @POST + @Path("upload") + @Consumes(MediaType.MULTIPART_FORM_DATA) + public Response uploadFile( + @FormDataParam("file") InputStream inputStream, + @FormDataParam("file") FormDataContentDisposition fileDetail) { + return Response.status(200).entity(fileDetail.getFileName()).build(); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 5b047e4e7..7a24ca1a9 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -21,15 +21,22 @@ package jtest.org.onap.ccsdk.sli.plugins.restapicall; +import java.net.URI; import java.util.HashMap; import java.util.Map; +import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; +import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.junit.Test; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.glassfish.jersey.server.ResourceConfig; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; public class TestRestapiCallNode { @@ -654,4 +661,24 @@ public class TestRestapiCallNode { RestapiCallNode rcn = new RestapiCallNode(); rcn.sendRequest(p, ctx); } + + @Test + public void testMultipartFormData() throws SvcLogicException { + final ResourceConfig resourceConfig = new ResourceConfig( + MultipartServerMock.class, MultiPartFeature.class); + GrizzlyHttpServerFactory.createHttpServer( + URI.create("http://localhost:8080/"),resourceConfig); + + Map p = new HashMap<>(); + p.put("multipartFormData", "true"); + p.put("format", "none"); + p.put("multipartFile", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://localhost:8080/file-upload/upload"); + + SvcLogicContext ctx = new SvcLogicContext(); + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + assertThat(ctx.getAttribute("response-code"), is("200")); + assertThat(ctx.getAttribute("httpResponse"), is( "test-template.json")); + } } -- cgit 1.2.3-korg From f98a2022690815ac159161f942950aac3b7ed9a6 Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Tue, 16 Apr 2019 12:00:40 +0530 Subject: Restapicallnode with cookie based auth Validate the cookie based auth feature of RestApiCallNode Fix multipart form data test to stop server after completion to avoid impacting other testcases Change-Id: I221b668978abf630f35cbb213687a25cc0de8b79 Issue-ID: CCSDK-239 Signed-off-by: Gaurav Agrawal --- restapi-call-node/provider/pom.xml | 1 + .../plugins/restapicall/MockCookieAuthServer.java | 40 ++++++++++++++++++++++ .../plugins/restapicall/TestRestapiCallNode.java | 25 +++++++++++++- 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 1f698eade..32089455f 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -93,4 +93,5 @@ test + diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java new file mode 100644 index 000000000..b4a30d3ab --- /dev/null +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - CCSDK + * ================================================================================ + * Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package jtest.org.onap.ccsdk.sli.plugins.restapicall; + +import javax.ws.rs.Consumes; +import javax.ws.rs.Produces; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.NewCookie; +import javax.ws.rs.core.Response; + +@Path("get-cookie") +public class MockCookieAuthServer { + @GET + @Path("cookie") + @Produces(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_JSON) + public Response getCookie() { + return Response.status(200).entity("success").cookie(new NewCookie("cookieResponse", "cookieValueInReturn")).build(); + } +} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 7a24ca1a9..52da46157 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -25,6 +25,7 @@ import java.net.URI; import java.util.HashMap; import java.util.Map; +import org.glassfish.grizzly.http.server.HttpServer; import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.junit.Test; @@ -666,7 +667,7 @@ public class TestRestapiCallNode { public void testMultipartFormData() throws SvcLogicException { final ResourceConfig resourceConfig = new ResourceConfig( MultipartServerMock.class, MultiPartFeature.class); - GrizzlyHttpServerFactory.createHttpServer( + HttpServer server = GrizzlyHttpServerFactory.createHttpServer( URI.create("http://localhost:8080/"),resourceConfig); Map p = new HashMap<>(); @@ -680,5 +681,27 @@ public class TestRestapiCallNode { rcn.sendRequest(p, ctx); assertThat(ctx.getAttribute("response-code"), is("200")); assertThat(ctx.getAttribute("httpResponse"), is( "test-template.json")); + server.shutdownNow(); + } + + @Test + public void testCookieResponse() throws SvcLogicException { + final ResourceConfig resourceConfig = new ResourceConfig( + MockCookieAuthServer.class); + HttpServer server = GrizzlyHttpServerFactory.createHttpServer( + URI.create("http://localhost:8080/"),resourceConfig); + + Map p = new HashMap<>(); + p.put("format", "none"); + p.put("httpMethod", "get"); + p.put("restapiUrl", "http://localhost:8080/get-cookie/cookie"); + p.put("dumpHeaders", "true"); + + SvcLogicContext ctx = new SvcLogicContext(); + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + assertThat(ctx.getAttribute("response-code"), is("200")); + assertThat(ctx.getAttribute("header.Set-Cookie"), is("cookieResponse=cookieValueInReturn;Version=1")); + server.shutdownNow(); } } -- cgit 1.2.3-korg From 5ddde36ddd17ef3cbcae6df12cd4862998d7f2ad Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 24 Apr 2019 13:55:43 -0400 Subject: Update to use released 1.2.2 parent Update to use released 1.2.2 version of parent poms. Change-Id: I303781ad2d8946a942212780884a96c1ac34d75c Issue-ID: CCSDK-1222 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- features/ccsdk-sli-plugins-all/pom.xml | 2 +- features/features-sli-plugins/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 2 +- grToolkit/features/features-gr-toolkit/pom.xml | 2 +- grToolkit/features/pom.xml | 2 +- grToolkit/installer/pom.xml | 2 +- grToolkit/model/pom.xml | 2 +- grToolkit/pom.xml | 2 +- grToolkit/provider/pom.xml | 2 +- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 2 +- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 2 +- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- restconf-client/features/ccsdk-restconf-client/pom.xml | 2 +- restconf-client/features/features-restconf-client/pom.xml | 2 +- restconf-client/features/pom.xml | 2 +- restconf-client/installer/pom.xml | 2 +- restconf-client/pom.xml | 2 +- restconf-client/provider/pom.xml | 2 +- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/pom.xml | 2 +- sshapi-call-node/installer/pom.xml | 2 +- sshapi-call-node/pom.xml | 2 +- sshapi-call-node/provider/pom.xml | 2 +- template-node/features/ccsdk-template-node/pom.xml | 2 +- template-node/features/features-template-node/pom.xml | 2 +- template-node/features/pom.xml | 2 +- template-node/installer/pom.xml | 2 +- template-node/pom.xml | 2 +- template-node/provider/pom.xml | 2 +- 43 files changed, 43 insertions(+), 43 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 911a1d6ab..2daa2c5b2 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index c589ba3f0..0ca186002 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index aff865f0a..c30fb147a 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index ed909fc22..9f0276044 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/features/pom.xml b/features/pom.xml index efd6cbe68..2aa82953c 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index 264ad7cf6..0ca01cd3f 100755 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index db2887436..2d9a6933a 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index c092a4b80..caadecac8 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 5d1743389..4f5780683 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index c917c4567..67b94d1ce 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index d2d79c706..c0be3d858 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index 51a850b8d..f2dad8b86 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 9e564d5e8..af41ee390 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 6412ca3ae..a8e642ea0 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 1f2da265c..56945da4b 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 23bfd53e2..06d45f638 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index d37160912..c8354be31 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 7ff022582..52a9539f8 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 532d5f7b9..c819973c9 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 0bf2a023d..c0703ce16 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 23b8f84b5..943ebbcac 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 8ca913bb8..ab665203f 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index cbc4a6ec1..c6c722765 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 7cdee7c50..3498bdc4c 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 32089455f..d22e3edcc 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 56fa2ebaf..3a143282d 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 56846fb45..a99be46ba 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index 5a882ebcd..ee2f035c6 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 4a454b14a..321b5b524 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 7f2e9c825..067166f8b 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index e6da0cd13..24db30ad4 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index ee153ad4e..18cfe9abc 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 421cbbaa7..34cecd0e0 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index cd045fde3..ec1125d6b 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 39c01db1b..844e52fe1 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 6583e69bf..bd5dd54ba 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index bdf471b25..13d5b0aaa 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index c5152dbc4..9a876be5d 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index dd9c8992f..a6d9681de 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2-SNAPSHOT + 1.2.2 diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index b498051f6..71ab77898 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index 44425d1e8..98ade668b 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/template-node/pom.xml b/template-node/pom.xml index c0843b787..2fd3cfdef 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index d52587922..4a44b6d5a 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.2.2-SNAPSHOT + 1.2.2 org.onap.ccsdk.sli.plugins -- cgit 1.2.3-korg From d5f883f63b0faf2b0c8a7c9bc9e384c4f893d766 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 30 Apr 2019 11:54:52 -0400 Subject: Roll master to El Alto Roll master version to El Alto versions Change-Id: Ifec94aaab874709c18ffcb03c2b7aa82c23ba2f9 Issue-ID: CCSDK-1222 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 ++-- features/ccsdk-sli-plugins-all/pom.xml | 4 ++-- features/features-sli-plugins/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 4 ++-- grToolkit/features/features-gr-toolkit/pom.xml | 4 ++-- grToolkit/features/pom.xml | 4 ++-- grToolkit/installer/pom.xml | 4 ++-- grToolkit/model/pom.xml | 4 ++-- grToolkit/pom.xml | 4 ++-- grToolkit/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 4 ++-- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- restconf-client/features/ccsdk-restconf-client/pom.xml | 4 ++-- restconf-client/features/features-restconf-client/pom.xml | 4 ++-- restconf-client/features/pom.xml | 4 ++-- restconf-client/installer/pom.xml | 4 ++-- restconf-client/pom.xml | 4 ++-- restconf-client/provider/pom.xml | 8 ++++---- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/pom.xml | 4 ++-- sshapi-call-node/installer/pom.xml | 4 ++-- sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/provider/pom.xml | 4 ++-- template-node/features/ccsdk-template-node/pom.xml | 4 ++-- template-node/features/features-template-node/pom.xml | 4 ++-- template-node/features/pom.xml | 4 ++-- template-node/installer/pom.xml | 4 ++-- template-node/pom.xml | 4 ++-- template-node/provider/pom.xml | 4 ++-- version.properties | 4 ++-- 44 files changed, 90 insertions(+), 90 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 2daa2c5b2..261b955e4 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.plugins sli-plugins-artifacts - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: sli-plugins-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.2.2 + 1.3.0-SNAPSHOT diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index 0ca186002..f36956a9c 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins-all - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index c30fb147a..931e46063 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-sli-plugins - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 9f0276044..58143e79f 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-features-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 2aa82953c..d8553b42f 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-feature-aggregator - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: features diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index 0ca01cd3f..37343c53c 100755 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-gr-toolkit - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index 2d9a6933a..441e2e855 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-gr-toolkit - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index caadecac8..a27e71853 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} gr-toolkit-features org.onap.ccsdk.sli.plugins - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 4f5780683..831edf707 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-gr-toolkit diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index 67b94d1ce..439b05f0c 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-model - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index c0be3d858..2cdc71d08 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins gr-toolkit - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: gr-toolkit diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index f2dad8b86..ee61d7d41 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle diff --git a/pom.xml b/pom.xml index af41ee390..e66a40794 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index a8e642ea0..ae007d6e4 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 56945da4b..0db5a9042 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 06d45f638..79d56ff04 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index c8354be31..42732871b 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 52a9539f8..de936d9f2 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index c819973c9..2e3b5e76c 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index c0703ce16..7062d6102 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 943ebbcac..b5329ea8f 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index ab665203f..4820b7dd5 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index c6c722765..d51cc610e 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 3498bdc4c..a84d3232d 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index d22e3edcc..a7a0842a4 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 3a143282d..677a24671 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restconf-client - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index a99be46ba..032a781e1 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-restconf-client - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index ee2f035c6..ae4000266 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-features - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 321b5b524..bcf9e998d 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 067166f8b..b9cad2629 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 24db30ad4..70f84e09d 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} @@ -49,7 +49,7 @@ org.onap.ccsdk.sli.plugins properties-node-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT org.opendaylight.yangtools @@ -73,7 +73,7 @@ org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT org.opendaylight.netconf diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index 18cfe9abc..a34b4aeee 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sshapi-call-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 34cecd0e0..04338facf 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-sshapi-call-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index ec1125d6b..35be47a4e 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-features - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 844e52fe1..029b94dea 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index bd5dd54ba..99c6d9edd 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 13d5b0aaa..81ab8811e 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index 9a876be5d..f7a708729 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-template-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index a6d9681de..3c6f6d853 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-template-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT feature diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 71ab77898..f919d1c09 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-features - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index 98ade668b..35161b8e5 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-installer - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/pom.xml b/template-node/pom.xml index 2fd3cfdef..b65c40e24 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT pom diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 4a44b6d5a..b47c60409 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.2.2 + 1.3.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-provider - 0.4.2-SNAPSHOT + 0.5.0-SNAPSHOT bundle ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/version.properties b/version.properties index 80a47aef7..c8bc76801 100644 --- a/version.properties +++ b/version.properties @@ -6,8 +6,8 @@ # Comment release_name=0 -sprint_number=4 -feature_revision=2 +sprint_number=5 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From a8287a9b4c1b679e04307669fffee6eb1d5f4ab5 Mon Sep 17 00:00:00 2001 From: Stan Bonev Date: Mon, 6 May 2019 10:09:48 -0400 Subject: Restapi: DELETE with payload doesn't work Change-Id: I50eeea493197010aba4b37af97dcedb446ed5d10 Issue-ID: CCSDK-1305 Signed-off-by: Stan Bonev --- .../sli/plugins/restapicall/RestapiCallNode.java | 25 ++++--- .../plugins/restapicall/TestRestapiCallNode.java | 81 +++++++++++++--------- 2 files changed, 64 insertions(+), 42 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index a7235fcb5..9b50eaa44 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -25,7 +25,6 @@ package org.onap.ccsdk.sli.plugins.restapicall; import static java.lang.Boolean.valueOf; import static javax.ws.rs.client.Entity.entity; import static org.onap.ccsdk.sli.plugins.restapicall.AuthType.fromString; - import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -52,8 +51,12 @@ import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; import javax.ws.rs.client.Invocation; import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.*; - +import javax.ws.rs.core.EntityTag; +import javax.ws.rs.core.Feature; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; import org.apache.commons.lang3.StringUtils; import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.HttpUrlConnectorProvider; @@ -94,8 +97,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { try (FileInputStream in = new FileInputStream(configDir + "/" + DME2_PROPERTIES_FILE_NAME)) { Properties props = new Properties(); props.load(in); - this.retryPolicyStore = new RetryPolicyStore(); - this.retryPolicyStore.setProxyServers(props.getProperty("proxyUrl")); + retryPolicyStore = new RetryPolicyStore(); + retryPolicyStore.setProxyServers(props.getProperty("proxyUrl")); log.info("DME2 support enabled"); } catch (Exception e) { log.warn("DME2 properties could not be read, DME2 support will not be enabled.", e); @@ -104,7 +107,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { try (FileInputStream in = new FileInputStream(configDir + "/" + UEB_PROPERTIES_FILE_NAME)) { Properties props = new Properties(); props.load(in); - this.uebServers = props.getProperty("servers"); + uebServers = props.getProperty("servers"); log.info("UEB support enabled"); } catch (Exception e) { log.warn("UEB properties could not be read, UEB support will not be enabled.", e); @@ -462,7 +465,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } long t2 = System.currentTimeMillis(); - log.info("Building {} completed. Time: {}", format, (t2 - t1)); + log.info("Building {} completed. Time: {}", format, t2 - t1); return req; } @@ -669,6 +672,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { invocationBuilder.header("X-ECOMP-RequestID", org.slf4j.MDC.get("X-ECOMP-RequestID")); + invocationBuilder.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); + Response response; try { @@ -739,7 +744,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } long t2 = System.currentTimeMillis(); - log.info(responseReceivedMessage, (t2 - t1)); + log.info(responseReceivedMessage, t2 - t1); log.info(responseHttpCodeMessage, r.code); log.info("HTTP response message: {}", r.message); logHeaders(r.headers); @@ -942,7 +947,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } long t2 = System.currentTimeMillis(); - log.info(responseReceivedMessage, (t2 - t1)); + log.info(responseReceivedMessage, t2 - t1); log.info(responseHttpCodeMessage, r.code); log.info("HTTP response message: {}", r.message); logHeaders(r.headers); @@ -1035,7 +1040,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } long t2 = System.currentTimeMillis(); - log.info(responseReceivedMessage, (t2 - t1)); + log.info(responseReceivedMessage, t2 - t1); log.info(responseHttpCodeMessage, r.code); logHeaders(r.headers); log.info("HTTP response:\n {}", r.body); diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 52da46157..3752a9c3f 100644 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -21,23 +21,21 @@ package jtest.org.onap.ccsdk.sli.plugins.restapicall; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; import java.net.URI; import java.util.HashMap; import java.util.Map; - import org.glassfish.grizzly.http.server.HttpServer; import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.glassfish.jersey.server.ResourceConfig; import org.junit.Test; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.glassfish.jersey.server.ResourceConfig; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; public class TestRestapiCallNode { @@ -48,7 +46,26 @@ public class TestRestapiCallNode { public void testDelete() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteWithPayload() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + ctx.setAttribute("prop.name", "site1"); + + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/sdwan-site.json"); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("restapiUser", "user1"); p.put("restapiPassword", "pwd1"); @@ -79,7 +96,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.siteAttachement[1].roles_length", "1"); ctx.setAttribute("prop.siteAttachement[1].roles[0]", "role2"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/sdwan-vpn-topology.json"); p.put("restapiUrl", "http://echo.getpostman.com"); p.put("restapiUser", "user1"); @@ -100,7 +117,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.name", "site1"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/sdwan-site.json"); p.put("restapiUrl", "http://echo.getpostman.com"); p.put("restapiUser", "user1"); @@ -140,7 +157,7 @@ public class TestRestapiCallNode { ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/test-template.json"); p.put("restapiUrl", "http://echo.getpostman.com"); p.put("restapiUser", "user1"); @@ -166,7 +183,7 @@ public class TestRestapiCallNode { ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/test-template.json"); p.put("restapiUrl", "http://echo.getpostman.com"); p.put("restapiUser", "user1"); @@ -192,7 +209,7 @@ public class TestRestapiCallNode { ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resourcess/test-template.json"); p.put("restapiUrl", "http://echo.getpostman.com"); p.put("restapiUser", "user1"); @@ -218,7 +235,7 @@ public class TestRestapiCallNode { ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/test-template.json"); p.put("restapiUrl", "http://echo.getpostman.com"); p.put("restapiUser", "user1"); @@ -244,7 +261,7 @@ public class TestRestapiCallNode { ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/test-template.json"); p.put("restapiUrl", "http://echo.getpostman.com"); p.put("restapiUser", "user1"); @@ -272,7 +289,7 @@ public class TestRestapiCallNode { ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/test-template.json"); p.put("restapiUrl", "http://echo. getpostman.com"); p.put("restapiUser", "user1"); @@ -292,7 +309,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); p.put("restapiUser", "admin"); @@ -338,7 +355,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.7"); ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/l3smsitetemplate.json"); p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites"); p.put("restapiUser", "admin"); @@ -362,7 +379,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/l3smvrftemplate.json"); p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vrf-attributes"); p.put("restapiUser", "admin"); @@ -382,7 +399,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - Map p = new HashMap(); + Map p = new HashMap<>(); //p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services" + "/vpnservice=10000000-0000-0000-0000-000000000001"); @@ -410,7 +427,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); ctx.setAttribute("prop.dci-connects.vni", "1"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/l2-dci-connects-template.json"); p.put("restapiUrl", "http://echo.getpostman.com"); p.put("restapiUser", "user1"); @@ -438,7 +455,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); ctx.setAttribute("prop.dci-connects.vni", "1"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/l3-dci-connects-template.json"); p.put("restapiUrl", "http://echo.getpostman.com"); p.put("restapiUser", "user1"); @@ -459,7 +476,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.user", "admin"); ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.password", "admin123"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/actokentemplate.json"); p.put("restapiUrl", "https://ipwan:18002/controller/v2/tokens"); p.put("format", "json"); @@ -476,7 +493,7 @@ public class TestRestapiCallNode { public void testDeleteNoneAsContentType() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("restapiUser", "user1"); p.put("restapiPassword", "pwd1"); @@ -494,7 +511,7 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); p.put("restapiUser", "admin"); @@ -512,7 +529,7 @@ public class TestRestapiCallNode { public void testDeleteOAuthType() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); p.put("oAuthConsumerSecret", "secret"); @@ -530,7 +547,7 @@ public class TestRestapiCallNode { public void testDeleteAuthTypeBasic() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("authType", "basic"); p.put("restapiUser", "admin"); @@ -547,7 +564,7 @@ public class TestRestapiCallNode { public void testDeleteAuthTypeDigest() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("authType", "digest"); p.put("restapiUser", "admin"); @@ -564,7 +581,7 @@ public class TestRestapiCallNode { public void testDeleteAuthTypeOAuth() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("authType", "oauth"); p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); @@ -583,7 +600,7 @@ public class TestRestapiCallNode { public void testDeleteAuthTypeNoneOAuth() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); p.put("oAuthConsumerSecret", "secret"); @@ -600,7 +617,7 @@ public class TestRestapiCallNode { public void testDeleteAuthTypeNoneBasic() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("restapiUser", "admin"); p.put("restapiPassword", "admin123"); @@ -616,7 +633,7 @@ public class TestRestapiCallNode { public void testInvalidDeleteAuthTypeOAuth() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("authType", "oauth"); p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); @@ -633,7 +650,7 @@ public class TestRestapiCallNode { public void testInvalidDeleteAuthTypeBasic() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("authType", "basic"); p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); @@ -650,7 +667,7 @@ public class TestRestapiCallNode { public void testInvalidDeleteAuthTypeDigest() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); - Map p = new HashMap(); + Map p = new HashMap<>(); p.put("restapiUrl", "https://echo.getpostman.com/delete"); p.put("authType", "digest"); p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); -- cgit 1.2.3-korg From c75880b15cebc206d43721b35299453f49406f20 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Wed, 22 May 2019 16:34:44 +0000 Subject: rest api call node unit tests rest api call node unit test added for the case in which a template mixes simple and complex json objects. Change-Id: I6921d6e328b3593464d82b7a45b1844cd88c3476 Issue-ID: CCSDK-1355 Signed-off-by: Smokowski, Kevin (ks6305) --- .../plugins/restapicall/MockCookieAuthServer.java | 40 -- .../plugins/restapicall/MultipartServerMock.java | 44 -- .../sli/plugins/restapicall/TestJsonParser.java | 73 -- .../plugins/restapicall/TestRestapiCallNode.java | 724 -------------------- .../sli/plugins/restapicall/TestXmlJsonUtil.java | 262 -------- .../sli/plugins/restapicall/TestXmlParser.java | 121 ---- .../plugins/restapicall/MockCookieAuthServer.java | 40 ++ .../plugins/restapicall/MultipartServerMock.java | 44 ++ .../sli/plugins/restapicall/TestJsonParser.java | 73 ++ .../plugins/restapicall/TestRestapiCallNode.java | 741 +++++++++++++++++++++ .../sli/plugins/restapicall/TestXmlJsonUtil.java | 262 ++++++++ .../sli/plugins/restapicall/TestXmlParser.java | 121 ++++ .../src/test/resources/testEmbeddedTemplate.json | 20 + 13 files changed, 1301 insertions(+), 1264 deletions(-) delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java delete mode 100644 restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java create mode 100644 restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java create mode 100644 restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java create mode 100644 restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java create mode 100644 restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java create mode 100644 restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java create mode 100644 restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java create mode 100644 restapi-call-node/provider/src/test/resources/testEmbeddedTemplate.json (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java deleted file mode 100644 index b4a30d3ab..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - CCSDK - * ================================================================================ - * Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package jtest.org.onap.ccsdk.sli.plugins.restapicall; - -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.NewCookie; -import javax.ws.rs.core.Response; - -@Path("get-cookie") -public class MockCookieAuthServer { - @GET - @Path("cookie") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response getCookie() { - return Response.status(200).entity("success").cookie(new NewCookie("cookieResponse", "cookieValueInReturn")).build(); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java deleted file mode 100644 index 9646272b4..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - CCSDK - * ================================================================================ - * Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package jtest.org.onap.ccsdk.sli.plugins.restapicall; - -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; - -import javax.ws.rs.Consumes; - -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.io.InputStream; - -@Path("file-upload") -public class MultipartServerMock { - - @POST - @Path("upload") - @Consumes(MediaType.MULTIPART_FORM_DATA) - public Response uploadFile( - @FormDataParam("file") InputStream inputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail) { - return Response.status(200).entity(fileDetail.getFileName()).build(); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java deleted file mode 100644 index 5526be81f..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java +++ /dev/null @@ -1,73 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.restapicall; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.restapicall.JsonParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestJsonParser { - - private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); - - @Test - public void test() throws SvcLogicException, IOException { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Map mm = JsonParser.convertToProperties(b.toString()); - - logProperties(mm); - - in.close(); - } - - @Test(expected = NullPointerException.class) - public void testNullString() throws SvcLogicException { - JsonParser.convertToProperties(null); - } - - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - log.info("Properties:"); - for (String name : ll) - log.info("--- {}: {}", name, mm.get(name)); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java deleted file mode 100644 index 3752a9c3f..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ /dev/null @@ -1,724 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.restapicall; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; -import org.glassfish.grizzly.http.server.HttpServer; -import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; -import org.glassfish.jersey.media.multipart.MultiPartFeature; -import org.glassfish.jersey.server.ResourceConfig; -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestRestapiCallNode { - - private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); - - - @Test - public void testDelete() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "pwd1"); - p.put("httpMethod", "delete"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteWithPayload() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - ctx.setAttribute("prop.name", "site1"); - - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/sdwan-site.json"); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "pwd1"); - p.put("httpMethod", "delete"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testJsonSdwanVpnTopologyTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - ctx.setAttribute("prop.topology", "topoType"); - - ctx.setAttribute("prop.roles_length", "1"); - ctx.setAttribute("prop.roles[0]", "role1"); - - ctx.setAttribute("prop.siteAttachement_length", "2"); - - ctx.setAttribute("prop.siteAttachement[0].siteId", "site1"); - ctx.setAttribute("prop.siteAttachement[0].roles_length", "0"); - ctx.setAttribute("prop.siteAttachement[0].roles[0]", "role1"); - ctx.setAttribute("prop.siteAttachement[0].roles[1]", "role3"); - - ctx.setAttribute("prop.siteAttachement[1].siteId", "site2"); - ctx.setAttribute("prop.siteAttachement[1].roles_length", "1"); - ctx.setAttribute("prop.siteAttachement[1].roles[0]", "role2"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/sdwan-vpn-topology.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testJsonSdwanSiteTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - ctx.setAttribute("prop.name", "site1"); - - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/sdwan-site.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testInvalidRepeatTimes() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "a"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidTemplatePath() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resourcess/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testWithoutSkipSending() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "false"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testFormData() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "false"); - p.put("multipartFormData", "true"); - p.put("multipartFile", "src/test/resources/test-template.json"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testWithInvalidURI() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo. getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "false"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testVpnJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testSiteJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - ctx.setAttribute("prop.l3vpn.site1_name", "10000000-0000-0000-0000-000000000002"); - ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); - ctx.setAttribute("prop.l3vpn.entry1-id", "1"); - ctx.setAttribute("prop.l3vpn.sna1_name", "10000000-0000-0000-0000-000000000004"); - ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); - ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b"); - ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1"); - ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2"); - ctx.setAttribute("prop.l3vpn.sna1_svlan", "100"); - ctx.setAttribute("prop.l3vpn.ac1_protocol", "static"); - ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24"); - ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4"); - - ctx.setAttribute("prop.l3vpn.site2_name", "10000000-0000-0000-0000-000000000005"); - ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); - ctx.setAttribute("prop.l3vpn.entry2-id", "1"); - ctx.setAttribute("prop.l3vpn.sna2_name", "10000000-0000-0000-0000-000000000007"); - ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); - ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c"); - ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.6"); - ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5"); - ctx.setAttribute("prop.l3vpn.sna2_svlan", "200"); - ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp"); - ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.7"); - ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/l3smsitetemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testVrfJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.vrf1-id", "10000000-0000-0000-0000-000000000007"); - ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); - ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); - ctx.setAttribute("prop.l3vpn.vrf2-id", "10000000-0000-0000-0000-000000000009"); - ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); - ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/l3smvrftemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vrf-attributes"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteVpnJsonTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - Map p = new HashMap<>(); - //p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services" - + "/vpnservice=10000000-0000-0000-0000-000000000001"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "json"); - p.put("httpMethod", "delete"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testL2DciTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.dci-connects.id", "Id1"); - ctx.setAttribute("prop.dci-connects.name", "Name1"); - ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); - ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); - ctx.setAttribute("prop.dci-connects.vni", "1"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/l2-dci-connects-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testL3DciTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.dci-connects.id", "Id1"); - ctx.setAttribute("prop.dci-connects.name", "Name1"); - ctx.setAttribute("prop.dci-connects.local_networks_length", "2"); - ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); - ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); - ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); - ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); - ctx.setAttribute("prop.dci-connects.vni", "1"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/l3-dci-connects-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - - } - - @Test - public void testControllerTokenTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.user", "admin"); - ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.password", "admin123"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/actokentemplate.json"); - p.put("restapiUrl", "https://ipwan:18002/controller/v2/tokens"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - - @Test - public void testDeleteNoneAsContentType() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "pwd1"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testPostNoneAsContentType() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); - ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); - p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("format", "none"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "restapi-result"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteOAuthType() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "basic"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeDigest() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "digest"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "oauth"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeNoneOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - @Test - public void testDeleteAuthTypeNoneBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "oauth"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "basic"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeDigest() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "digest"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testMultipartFormData() throws SvcLogicException { - final ResourceConfig resourceConfig = new ResourceConfig( - MultipartServerMock.class, MultiPartFeature.class); - HttpServer server = GrizzlyHttpServerFactory.createHttpServer( - URI.create("http://localhost:8080/"),resourceConfig); - - Map p = new HashMap<>(); - p.put("multipartFormData", "true"); - p.put("format", "none"); - p.put("multipartFile", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://localhost:8080/file-upload/upload"); - - SvcLogicContext ctx = new SvcLogicContext(); - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - assertThat(ctx.getAttribute("response-code"), is("200")); - assertThat(ctx.getAttribute("httpResponse"), is( "test-template.json")); - server.shutdownNow(); - } - - @Test - public void testCookieResponse() throws SvcLogicException { - final ResourceConfig resourceConfig = new ResourceConfig( - MockCookieAuthServer.class); - HttpServer server = GrizzlyHttpServerFactory.createHttpServer( - URI.create("http://localhost:8080/"),resourceConfig); - - Map p = new HashMap<>(); - p.put("format", "none"); - p.put("httpMethod", "get"); - p.put("restapiUrl", "http://localhost:8080/get-cookie/cookie"); - p.put("dumpHeaders", "true"); - - SvcLogicContext ctx = new SvcLogicContext(); - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - assertThat(ctx.getAttribute("response-code"), is("200")); - assertThat(ctx.getAttribute("header.Set-Cookie"), is("cookieResponse=cookieValueInReturn;Version=1")); - server.shutdownNow(); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java deleted file mode 100644 index 11eeba7f0..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java +++ /dev/null @@ -1,262 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.restapicall; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.Assert; -import org.junit.Test; -import org.onap.ccsdk.sli.plugins.restapicall.XmlJsonUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class TestXmlJsonUtil { - - private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); - - @Test - public void test() { - Map mm = new HashMap<>(); - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); - mm.put("service-data.service-information.service-instance-id", "someinstance001"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3_length", "2"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); - - mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", - "trinity-transcodingProfile"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf_length", "1"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); - - mm.put("service-data.vnf-config-parameters-list." + - "vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", - "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); - - mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); - mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); - mm.put("service-data.vnf-config-information.vendor", "Netconf"); - - mm.put("service-data.vnf-config-information.escape-test", - "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); - - String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); - log.info(ss); - - ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address"); - log.info(ss); - - ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address"); - log.info(ss); - } - - @Test - public void testRemoveEmptyStructXml() { - String xmlin = "" + - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " blah\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " blah blah\n" + - "\n"; - - String xmloutexpected = "" + - "\n" + - " \n" + - " blah\n" + - " \n" + - " blah blah\n" + - "\n"; - - String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); - log.info(xmlout); - - Assert.assertEquals(xmloutexpected, xmlout); - } - - @Test - public void testRemoveEmptyStructJson() { - String xmlin = "{\r\n" + - " \"T1\":{\r\n" + - " \"T2\":{\r\n" + - " \"T3\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T4\":{\r\n" + - " \"T12\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T13\":[ ],\r\n" + - " \"T14\":{\r\n" + - " \"T15\":{\r\n" + - " \r\n" + - " },\r\n" + - " \"T16\":{\r\n" + - " \r\n" + - " }\r\n" + - " }\r\n" + - " },\r\n" + - " \"T5\":{\r\n" + - " \"T6\":[\r\n" + - " \r\n" + - " ],\r\n" + - " \"T7\":[\r\n" + - " \"T8\":{\r\n" + - " \r\n" + - " },\r\n" + - " \"T9\":{ },\r\n" + - " \"T10\":\"blah\",\r\n" + - " \"T11\":[\r\n" + - " \r\n" + - " ]\r\n" + - " ]\r\n" + - " }\r\n" + - " }\r\n" + - " }\r\n" + - "}\r\n" + - ""; - - String xmloutexpected = "{\r\n" + - " \"T1\":{\r\n" + - " \"T2\":{\r\n" + - " \"T5\":{\r\n" + - " \"T7\":[\r\n" + - " \"T10\":\"blah\",\r\n" + - " ]\r\n" + - " }\r\n" + - " }\r\n" + - " }\r\n" + - "}\r\n" + - ""; - - String xmlout = XmlJsonUtil.removeEmptyStructJson(null, xmlin); - log.info(xmlout); - - Assert.assertEquals(xmloutexpected, xmlout); - } -} diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java deleted file mode 100644 index c6bf4a8b9..000000000 --- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java +++ /dev/null @@ -1,121 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package jtest.org.onap.ccsdk.sli.plugins.restapicall; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.junit.Test; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.plugins.restapicall.XmlParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TestXmlParser { - - private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); - - @Test - public void test() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("project.dependencies.dependency"); - listNameList.add("project.build.plugins.plugin"); - listNameList.add("project.build.plugins.plugin.executions.execution"); - listNameList.add("project.build.pluginManagement.plugins.plugin"); - listNameList.add("project.build.pluginManagement." + - "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - logProperties(mm); - in.close(); - } - - @Test - public void testValidLength() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - - assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport[5]"), is("SET_RESET_LP")); - assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport[0]"), is("SET_BVOIP_IN")); - - logProperties(mm); - in.close(); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidLength() throws Exception { - BufferedReader in = new BufferedReader( - new InputStreamReader(ClassLoader.getSystemResourceAsStream("invalidlength.xml")) - ); - StringBuilder b = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) - b.append(line).append('\n'); - - Set listNameList = new HashSet(); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); - listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); - - Map mm = XmlParser.convertToProperties(b.toString(), listNameList); - logProperties(mm); - in.close(); - } - - private void logProperties(Map mm) { - List ll = new ArrayList<>(); - for (Object o : mm.keySet()) - ll.add((String) o); - Collections.sort(ll); - - log.info("Properties:"); - for (String name : ll) - log.info("--- " + name + ": " + mm.get(name)); - } -} diff --git a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java new file mode 100644 index 000000000..7e1e0d505 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/MockCookieAuthServer.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - CCSDK + * ================================================================================ + * Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.ccsdk.sli.plugins.restapicall; + +import javax.ws.rs.Consumes; +import javax.ws.rs.Produces; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.NewCookie; +import javax.ws.rs.core.Response; + +@Path("get-cookie") +public class MockCookieAuthServer { + @GET + @Path("cookie") + @Produces(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_JSON) + public Response getCookie() { + return Response.status(200).entity("success").cookie(new NewCookie("cookieResponse", "cookieValueInReturn")).build(); + } +} diff --git a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java new file mode 100644 index 000000000..00b5c324d --- /dev/null +++ b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/MultipartServerMock.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - CCSDK + * ================================================================================ + * Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.ccsdk.sli.plugins.restapicall; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.ws.rs.Consumes; + +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.io.InputStream; + +@Path("file-upload") +public class MultipartServerMock { + + @POST + @Path("upload") + @Consumes(MediaType.MULTIPART_FORM_DATA) + public Response uploadFile( + @FormDataParam("file") InputStream inputStream, + @FormDataParam("file") FormDataContentDisposition fileDetail) { + return Response.status(200).entity(fileDetail.getFileName()).build(); + } +} diff --git a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java new file mode 100644 index 000000000..e4ec9147c --- /dev/null +++ b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestJsonParser.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.JsonParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestJsonParser { + + private static final Logger log = LoggerFactory.getLogger(TestJsonParser.class); + + @Test + public void test() throws SvcLogicException, IOException { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test.json")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Map mm = JsonParser.convertToProperties(b.toString()); + + logProperties(mm); + + in.close(); + } + + @Test(expected = NullPointerException.class) + public void testNullString() throws SvcLogicException { + JsonParser.convertToProperties(null); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + log.info("Properties:"); + for (String name : ll) + log.info("--- {}: {}", name, mm.get(name)); + } +} diff --git a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java new file mode 100644 index 000000000..bdf67dc45 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -0,0 +1,741 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; +import org.codehaus.jettison.json.JSONObject; +import org.glassfish.grizzly.http.server.HttpServer; +import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; +import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.glassfish.jersey.server.ResourceConfig; +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestRestapiCallNode { + + private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); + + + @Test + public void testDelete() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteWithPayload() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + ctx.setAttribute("prop.name", "site1"); + + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/sdwan-site.json"); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonSdwanVpnTopologyTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + ctx.setAttribute("prop.topology", "topoType"); + + ctx.setAttribute("prop.roles_length", "1"); + ctx.setAttribute("prop.roles[0]", "role1"); + + ctx.setAttribute("prop.siteAttachement_length", "2"); + + ctx.setAttribute("prop.siteAttachement[0].siteId", "site1"); + ctx.setAttribute("prop.siteAttachement[0].roles_length", "0"); + ctx.setAttribute("prop.siteAttachement[0].roles[0]", "role1"); + ctx.setAttribute("prop.siteAttachement[0].roles[1]", "role3"); + + ctx.setAttribute("prop.siteAttachement[1].siteId", "site2"); + ctx.setAttribute("prop.siteAttachement[1].roles_length", "1"); + ctx.setAttribute("prop.siteAttachement[1].roles[0]", "role2"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/sdwan-vpn-topology.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonSdwanSiteTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + ctx.setAttribute("prop.name", "site1"); + + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/sdwan-site.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testInvalidRepeatTimes() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "a"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidTemplatePath() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resourcess/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testWithoutSkipSending() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testFormData() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + p.put("multipartFormData", "true"); + p.put("multipartFile", "src/test/resources/test-template.json"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testWithInvalidURI() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo. getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testVpnJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testSiteJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + ctx.setAttribute("prop.l3vpn.site1_name", "10000000-0000-0000-0000-000000000002"); + ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); + ctx.setAttribute("prop.l3vpn.entry1-id", "1"); + ctx.setAttribute("prop.l3vpn.sna1_name", "10000000-0000-0000-0000-000000000004"); + ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); + ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b"); + ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1"); + ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2"); + ctx.setAttribute("prop.l3vpn.sna1_svlan", "100"); + ctx.setAttribute("prop.l3vpn.ac1_protocol", "static"); + ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24"); + ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4"); + + ctx.setAttribute("prop.l3vpn.site2_name", "10000000-0000-0000-0000-000000000005"); + ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); + ctx.setAttribute("prop.l3vpn.entry2-id", "1"); + ctx.setAttribute("prop.l3vpn.sna2_name", "10000000-0000-0000-0000-000000000007"); + ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); + ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c"); + ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.6"); + ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5"); + ctx.setAttribute("prop.l3vpn.sna2_svlan", "200"); + ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp"); + ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.7"); + ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l3smsitetemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testVrfJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.vrf1-id", "10000000-0000-0000-0000-000000000007"); + ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); + ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); + ctx.setAttribute("prop.l3vpn.vrf2-id", "10000000-0000-0000-0000-000000000009"); + ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); + ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l3smvrftemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vrf-attributes"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteVpnJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap<>(); + //p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services" + + "/vpnservice=10000000-0000-0000-0000-000000000001"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "delete"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testL2DciTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.dci-connects.id", "Id1"); + ctx.setAttribute("prop.dci-connects.name", "Name1"); + ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); + ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); + ctx.setAttribute("prop.dci-connects.vni", "1"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l2-dci-connects-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testL3DciTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.dci-connects.id", "Id1"); + ctx.setAttribute("prop.dci-connects.name", "Name1"); + ctx.setAttribute("prop.dci-connects.local_networks_length", "2"); + ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); + ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); + ctx.setAttribute("prop.dci-connects.vni", "1"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l3-dci-connects-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + + } + + @Test + public void testControllerTokenTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.user", "admin"); + ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.password", "admin123"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/actokentemplate.json"); + p.put("restapiUrl", "https://ipwan:18002/controller/v2/tokens"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + + @Test + public void testDeleteNoneAsContentType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testPostNoneAsContentType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "none"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteOAuthType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "basic"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeDigest() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "digest"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "oauth"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteAuthTypeNoneOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("oAuthSignatureMethod", "plainTEXT"); + p.put("oAuthVersion", "1.0"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + @Test + public void testDeleteAuthTypeNoneBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeOAuth() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "oauth"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeBasic() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "basic"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidDeleteAuthTypeDigest() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("authType", "digest"); + p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); + p.put("oAuthConsumerSecret", "secret"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testMultipartFormData() throws SvcLogicException { + final ResourceConfig resourceConfig = new ResourceConfig( + MultipartServerMock.class, MultiPartFeature.class); + HttpServer server = GrizzlyHttpServerFactory.createHttpServer( + URI.create("http://localhost:8080/"),resourceConfig); + + Map p = new HashMap<>(); + p.put("multipartFormData", "true"); + p.put("format", "none"); + p.put("multipartFile", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://localhost:8080/file-upload/upload"); + + SvcLogicContext ctx = new SvcLogicContext(); + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + assertThat(ctx.getAttribute("response-code"), is("200")); + assertThat(ctx.getAttribute("httpResponse"), is( "test-template.json")); + server.shutdownNow(); + } + + @Test + public void testCookieResponse() throws SvcLogicException { + final ResourceConfig resourceConfig = new ResourceConfig( + MockCookieAuthServer.class); + HttpServer server = GrizzlyHttpServerFactory.createHttpServer( + URI.create("http://localhost:8080/"),resourceConfig); + + Map p = new HashMap<>(); + p.put("format", "none"); + p.put("httpMethod", "get"); + p.put("restapiUrl", "http://localhost:8080/get-cookie/cookie"); + p.put("dumpHeaders", "true"); + + SvcLogicContext ctx = new SvcLogicContext(); + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + assertThat(ctx.getAttribute("response-code"), is("200")); + assertThat(ctx.getAttribute("header.Set-Cookie"), is("cookieResponse=cookieValueInReturn;Version=1")); + server.shutdownNow(); + } + + @Test + public void testEmbeddedJsonTemplate() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); + String complexObj = "{\"image_name\":\"Ubuntu 14.04\",\"service-instance-id\":\"1\",\"vnf-model-customization-uuid\":\"2f\",\"vnf-id\":\"3b\"}"; + ctx.setAttribute("reqId", "1235"); + ctx.setAttribute("subReqId", "054243"); + ctx.setAttribute("actionName", "CREATE"); + ctx.setAttribute("myPrefix", "2016-09-09 16:30:35.0"); + ctx.setAttribute("complexObj", complexObj); + RestapiCallNode rcn = new RestapiCallNode(); + String request = rcn.buildXmlJsonRequest(ctx, rcn.readFile("src/test/resources/testEmbeddedTemplate.json"), Format.JSON); + //This will throw a JSONException and fail the test case if rest api call node doesn't form valid JSON + JSONObject requestObj = new JSONObject(request); + } + +} diff --git a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java new file mode 100644 index 000000000..9812f2a11 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java @@ -0,0 +1,262 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; +import org.onap.ccsdk.sli.plugins.restapicall.XmlJsonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class TestXmlJsonUtil { + + private static final Logger log = LoggerFactory.getLogger(TestXmlJsonUtil.class); + + @Test + public void test() { + Map mm = new HashMap<>(); + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].vnf-type", "N-SBG"); + mm.put("service-data.service-information.service-instance-id", "someinstance001"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-server-ip-address", "10.11.12.13"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].escf-domain-name", "hclab.atttest.com"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3_length", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-v3-id", "1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-target-ip-address", "127.0.0.1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[0].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-v3-id", "2"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-target-ip-address", "192.168.1.8"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].snmp-target-v3[1].snmp-security-level", "NO_AUTH_NO_PRIV"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-1", "2001:1890:1001:2224::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].dns-ip-address-2", "2001:1890:1001:2424::1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-realm-name", "uvp.els-an.att.net"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].diameter-rf-peer-ip-address", "192.168.1.66"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-controller-ip-address", "192.168.1.186"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].bgf-control-link-name", "mg3/69@192.168.1.226"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-interface-nexthop-ip-address", "10.111.108.150"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].rf-mated-pair-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list.vnf-config-parameters[0].access-net-pcscf_length", "4"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].network-name", "UvpbUgnAccess1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.146"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].network-name", "MIS"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].next-hop-ip-address", "10.111.108.158"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[1].subnet-mask-length", "10.111.108.154"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].next-hop-ip-address", "10.111.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[2].subnet-mask-length", "10.111.108.162"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].network-name", "AVPN1"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].proactive-transcoding-profile", + "trinity-transcodingProfile"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].next-hop-ip-address", "10.129.108.166"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].access-net-pcscf[3].subnet-mask-length", "10.129.108.162"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf_length", "1"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].network-name", "Core"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].next-hop-ip-address", "10.111.108.142"); + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].core-net-pcscf[0].sip-pa-termination-ip-address", "10.111.108.138"); + + mm.put("service-data.vnf-config-parameters-list." + + "vnf-config-parameters[0].mated-pair-fully-qualified-domain-name", + "mt1nj01sbg01pyl-mt1nj01sbg02pyl.ar1ga.uvp.els-an.att.net"); + + mm.put("service-data.appc-request-header.svc-request-id", "SOMESERVICEREQUEST123451000"); + mm.put("service-data.vnf-config-information.vnf-host-ip-address", "192.168.13.151"); + mm.put("service-data.vnf-config-information.vendor", "Netconf"); + + mm.put("service-data.vnf-config-information.escape-test", + "blah blah \"xxx&nnn<>\\'\"there>blah<&''\"\"123\\\\\\'''blah blah &"); + + String ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-parameters-list"); + log.info(ss); + + ss = XmlJsonUtil.getXml(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-parameters-list.vnf-config-parameters"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + + ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address"); + log.info(ss); + } + + @Test + public void testRemoveEmptyStructXml() { + String xmlin = "" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmloutexpected = "" + + "\n" + + " \n" + + " blah\n" + + " \n" + + " blah blah\n" + + "\n"; + + String xmlout = XmlJsonUtil.removeEmptyStructXml(xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } + + @Test + public void testRemoveEmptyStructJson() { + String xmlin = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T3\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T4\":{\r\n" + + " \"T12\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T13\":[ ],\r\n" + + " \"T14\":{\r\n" + + " \"T15\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T16\":{\r\n" + + " \r\n" + + " }\r\n" + + " }\r\n" + + " },\r\n" + + " \"T5\":{\r\n" + + " \"T6\":[\r\n" + + " \r\n" + + " ],\r\n" + + " \"T7\":[\r\n" + + " \"T8\":{\r\n" + + " \r\n" + + " },\r\n" + + " \"T9\":{ },\r\n" + + " \"T10\":\"blah\",\r\n" + + " \"T11\":[\r\n" + + " \r\n" + + " ]\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmloutexpected = "{\r\n" + + " \"T1\":{\r\n" + + " \"T2\":{\r\n" + + " \"T5\":{\r\n" + + " \"T7\":[\r\n" + + " \"T10\":\"blah\",\r\n" + + " ]\r\n" + + " }\r\n" + + " }\r\n" + + " }\r\n" + + "}\r\n" + + ""; + + String xmlout = XmlJsonUtil.removeEmptyStructJson(null, xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } +} diff --git a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java new file mode 100644 index 000000000..326c9ca89 --- /dev/null +++ b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlParser.java @@ -0,0 +1,121 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestXmlParser { + + private static final Logger log = LoggerFactory.getLogger(TestXmlParser.class); + + @Test + public void test() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("project.dependencies.dependency"); + listNameList.add("project.build.plugins.plugin"); + listNameList.add("project.build.plugins.plugin.executions.execution"); + listNameList.add("project.build.pluginManagement.plugins.plugin"); + listNameList.add("project.build.pluginManagement." + + "plugins.plugin.configuration.lifecycleMappingMetadata.pluginExecutions.pluginExecution"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + + @Test + public void testValidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("test3.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport[5]"), is("SET_RESET_LP")); + assertThat(mm.get("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport[0]"), is("SET_BVOIP_IN")); + + logProperties(mm); + in.close(); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidLength() throws Exception { + BufferedReader in = new BufferedReader( + new InputStreamReader(ClassLoader.getSystemResourceAsStream("invalidlength.xml")) + ); + StringBuilder b = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) + b.append(line).append('\n'); + + Set listNameList = new HashSet(); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfImport"); + listNameList.add("ApplyGroupResponse.ApplyGroupResponseData.VrfDetails.VrfExport"); + + Map mm = XmlParser.convertToProperties(b.toString(), listNameList); + logProperties(mm); + in.close(); + } + + private void logProperties(Map mm) { + List ll = new ArrayList<>(); + for (Object o : mm.keySet()) + ll.add((String) o); + Collections.sort(ll); + + log.info("Properties:"); + for (String name : ll) + log.info("--- " + name + ": " + mm.get(name)); + } +} diff --git a/restapi-call-node/provider/src/test/resources/testEmbeddedTemplate.json b/restapi-call-node/provider/src/test/resources/testEmbeddedTemplate.json new file mode 100644 index 000000000..7f2377813 --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/testEmbeddedTemplate.json @@ -0,0 +1,20 @@ +{ + "commonHeader": { + "origin": "earth", + "requestId": ${reqId}, + "subRequestId": ${subReqId} + }, + "actions": { + "actionName": ${actionName}, + "mode": "sync" + }, + "payload": { + "assignment-request": { + "prefix": [ + ${myPrefix} + ], + "assignment-properties": ${'"complexObj} + } + } +} + -- cgit 1.2.3-korg From a7430938d2b83b6fe9b03360ff54206fd1259885 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Fri, 17 May 2019 21:09:28 +0000 Subject: implement generic retry and partners in restapicallnode implement generic retry and partners in restapicallnode Change-Id: I436622dda5a5a83b029c935b929f43e05d37a2a0 Issue-ID: CCSDK-1343 Signed-off-by: Smokowski, Kevin (ks6305) --- .../ccsdk/sli/plugins/restapicall/Parameters.java | 1 + .../sli/plugins/restapicall/PartnerDetails.java | 14 + .../sli/plugins/restapicall/RestapiCallNode.java | 169 ++++--- .../ccsdk/sli/plugins/restapicall/RetryPolicy.java | 59 +-- .../sli/plugins/restapicall/RetryPolicyStore.java | 50 -- .../plugins/restapicall/TestRestapiCallNode.java | 348 +++----------- .../plugins/restapicall/TestRestapiCallNode.java | 511 +++++++++++++++++++++ .../provider/src/test/resources/partners.json | 16 + .../restconfapicall/RestconfApiCallNode.java | 57 +-- 9 files changed, 747 insertions(+), 478 deletions(-) mode change 100644 => 100755 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java create mode 100755 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/PartnerDetails.java mode change 100644 => 100755 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java delete mode 100644 restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java mode change 100644 => 100755 restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java create mode 100755 restapi-call-node/provider/src/test/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java create mode 100755 restapi-call-node/provider/src/test/resources/partners.json (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java old mode 100644 new mode 100755 index aeb07c4d6..8b9cdc39c --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java @@ -26,6 +26,7 @@ import java.util.Set; public class Parameters { public String templateFileName; public String restapiUrl; + public String restapiUrlSuffix; public String restapiUser; public String restapiPassword; public Format format; diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/PartnerDetails.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/PartnerDetails.java new file mode 100755 index 000000000..1cd4b99bb --- /dev/null +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/PartnerDetails.java @@ -0,0 +1,14 @@ +package org.onap.ccsdk.sli.plugins.restapicall; + +public class PartnerDetails { + protected String username; + protected String password; + protected String url; + + public PartnerDetails(String username, String password, String url) { + this.username = username; + this.password = password; + this.url = url; + } + +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java old mode 100644 new mode 100755 index 9b50eaa44..34e5dec21 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -37,6 +37,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -57,7 +58,10 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; +import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; +import org.codehaus.jettison.json.JSONException; +import org.codehaus.jettison.json.JSONObject; import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; @@ -66,6 +70,8 @@ import org.glassfish.jersey.client.oauth1.OAuth1ClientSupport; import org.glassfish.jersey.media.multipart.MultiPart; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; +import org.glassfish.jersey.client.oauth1.ConsumerCredentials; +import org.glassfish.jersey.client.oauth1.OAuth1ClientSupport; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; @@ -74,34 +80,36 @@ import org.slf4j.LoggerFactory; public class RestapiCallNode implements SvcLogicJavaPlugin { - protected static final String DME2_PROPERTIES_FILE_NAME = "dme2.properties"; + protected static final String PARTNERS_FILE_NAME = "partners.json"; protected static final String UEB_PROPERTIES_FILE_NAME = "ueb.properties"; protected static final String DEFAULT_PROPERTIES_DIR = "/opt/onap/ccsdk/data/properties"; protected static final String PROPERTIES_DIR_KEY = "SDNC_CONFIG_DIR"; private static final Logger log = LoggerFactory.getLogger(RestapiCallNode.class); - protected RetryPolicyStore retryPolicyStore; private String uebServers; private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; private String responseReceivedMessage = "Response received. Time: {}"; private String responseHttpCodeMessage = "HTTP response code: {}"; private String requestPostingException = "Exception while posting http request to client "; - private static String skipSendingMessage = "skipSending"; - private static String responsePrefix = "responsePrefix"; - private static String restapiUrlString = "restapiUrl"; + protected static final String skipSendingMessage = "skipSending"; + protected static final String responsePrefix = "responsePrefix"; + protected static final String restapiUrlString = "restapiUrl"; + protected static final String restapiUserKey = "restapiUser"; + protected static final String restapiPasswordKey = "restapiPassword"; - public RestapiCallNode() { - String configDir = System.getProperty(PROPERTIES_DIR_KEY, DEFAULT_PROPERTIES_DIR); + protected HashMap partnerStore; - try (FileInputStream in = new FileInputStream(configDir + "/" + DME2_PROPERTIES_FILE_NAME)) { - Properties props = new Properties(); - props.load(in); - retryPolicyStore = new RetryPolicyStore(); - retryPolicyStore.setProxyServers(props.getProperty("proxyUrl")); - log.info("DME2 support enabled"); + public RestapiCallNode() { + String configDir = System.getProperty(PROPERTIES_DIR_KEY, DEFAULT_PROPERTIES_DIR); + try { + String jsonString = readFile(configDir + "/" + PARTNERS_FILE_NAME); + JSONObject partners = new JSONObject(jsonString); + partnerStore = new HashMap(); + loadPartners(partners); + log.info("Partners support enabled"); } catch (Exception e) { - log.warn("DME2 properties could not be read, DME2 support will not be enabled.", e); + log.warn("Partners file could not be read, Partner support will not be enabled.", e); } try (FileInputStream in = new FileInputStream(configDir + "/" + UEB_PROPERTIES_FILE_NAME)) { @@ -114,6 +122,35 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } } + protected void loadPartners(JSONObject partners) { + Iterator keys = partners.keys(); + String partnerUserKey = "user"; + String partnerPasswordKey = "password"; + String partnerUrlKey = "url"; + + while (keys.hasNext()) { + String partnerKey = keys.next(); + try { + JSONObject partnerObject = (JSONObject) partners.get(partnerKey); + if (partnerObject.has(partnerUserKey) && partnerObject.has(partnerPasswordKey)) { + String url = null; + if (partnerObject.has(partnerUrlKey)) { + url = partnerObject.getString(partnerUrlKey); + } + String userName = partnerObject.getString(partnerUserKey); + String password = partnerObject.getString(partnerPasswordKey); + PartnerDetails details = new PartnerDetails(userName, password, url); + partnerStore.put(partnerKey, details); + log.info("mapped partner using partner key " + partnerKey); + } else { + log.info("Partner " + partnerKey + " is missing required keys, it won't be mapped"); + } + } catch (JSONException e) { + log.info("Couldn't map the partner using partner key " + partnerKey, e); + } + } + } + /** * Returns parameters from the parameter map. * @@ -125,14 +162,21 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { public static Parameters getParameters(Map paramMap, Parameters p) throws SvcLogicException { - p.templateFileName = parseParam(paramMap, "templateFileName", + + p.templateFileName = parseParam(paramMap, "templateFileName", false, null); p.requestBody = parseParam(paramMap, "requestBody", false, null); p.restapiUrl = parseParam(paramMap, restapiUrlString, true, null); validateUrl(p.restapiUrl); - p.restapiUser = parseParam(paramMap, "restapiUser", false, null); - p.restapiPassword = parseParam(paramMap, "restapiPassword", false, + p.restapiUrlSuffix = parseParam(paramMap, "restapiUrlSuffix", + false, null); + p.restapiUser = parseParam(paramMap, restapiUserKey, false, null); + p.restapiPassword = parseParam(paramMap, restapiPasswordKey, false, null); + if(p.restapiUrlSuffix != null) { + p.restapiUrl = p.restapiUrl + p.restapiUrlSuffix; + validateUrl(p.restapiUrl); + } p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", false, null); p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", @@ -185,14 +229,19 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { * @param restapiUrl rest api URL * @throws SvcLogicException when URL validation fails */ - private static void validateUrl(String restapiUrl) - throws SvcLogicException { - try { - URI.create(restapiUrl); - } catch (IllegalArgumentException e) { - throw new SvcLogicException("Invalid input of url " - + e.getLocalizedMessage(), e); - } + private static void validateUrl(String restapiUrl) throws SvcLogicException { + if (restapiUrl.contains(",")) { + String[] urls = restapiUrl.split(","); + for(String url : urls) { + validateUrl(url); + } + } else { + try { + URI.create(restapiUrl); + } catch (IllegalArgumentException e) { + throw new SvcLogicException("Invalid input of url " + e.getLocalizedMessage(), e); + } + } } /** @@ -262,14 +311,6 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { return value.toString(); } - public RetryPolicyStore getRetryPolicyStore() { - return retryPolicyStore; - } - - public void setRetryPolicyStore(RetryPolicyStore retryPolicyStore) { - this.retryPolicyStore = retryPolicyStore; - } - /** * Allows Directed Graphs the ability to interact with REST APIs. * @param paramMap HashMap of parameters passed by the DG to this function @@ -293,7 +334,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { * * * - * + * * * *
convertResponse Optionalwhether the response should be convertedtrue or false
customHttpHeadersOptionala list additional http headers to be passed in, follow the format in the exampleX-CSI-MessageId=messageId,headerFieldName=headerFieldValue
dumpHeadersOptionalwhen true writes http header content to context memorytrue or false
partnerOptionalneeded for DME2 callsdme2proxy
partnerOptionalused to retrieve username, password and url if partner store existsaaf
returnRequestPayloadOptionalused to return payload built in the requesttrue or false
@@ -306,15 +347,17 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { sendRequest(paramMap, ctx, null); } - public void sendRequest(Map paramMap, SvcLogicContext ctx, Integer retryCount) + protected void sendRequest(Map paramMap, SvcLogicContext ctx, RetryPolicy retryPolicy) throws SvcLogicException { - RetryPolicy retryPolicy = null; HttpResponse r = new HttpResponse(); try { + handlePartner(paramMap); Parameters p = getParameters(paramMap, new Parameters()); - if (p.partner != null) { - retryPolicy = retryPolicyStore.getRetryPolicy(p.partner); + if(p.restapiUrl.contains(",") && retryPolicy == null) { + String[] urls = p.restapiUrl.split(","); + retryPolicy = new RetryPolicy(urls,urls.length * 2); + p.restapiUrl = urls[0]; } String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; @@ -367,36 +410,20 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (retryPolicy == null || !shouldRetry) { setFailureResponseStatus(ctx, prefix, e.getMessage(), r); } else { - if (retryCount == null) { - retryCount = 0; - } - String retryMessage = retryCount + " attempts were made out of " + retryPolicy.getMaximumRetries() + - " maximum retries."; - log.debug(retryMessage); + log.debug(retryPolicy.getRetryMessage()); try { - retryCount = retryCount + 1; - if (retryCount < retryPolicy.getMaximumRetries() + 1) { - URI uri = new URI(paramMap.get(restapiUrlString)); - String hostname = uri.getHost(); - String retryString = retryPolicy.getNextHostName(uri.toString()); - URI uriTwo = new URI(retryString); - URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port(uriTwo.getPort()).scheme( - uriTwo.getScheme()).build(); - paramMap.put(restapiUrlString, retryUri.toString()); - log.debug("URL was set to {}", retryUri.toString()); - log.debug("Failed to communicate with host {}. Request will be re-attempted using the host {}.", - hostname, retryString); - log.debug("This is retry attempt {} out of {}", retryCount, retryPolicy.getMaximumRetries()); - sendRequest(paramMap, ctx, retryCount); + //calling getNextHostName increments the retry count so it should be called before shouldRetry + String retryString = retryPolicy.getNextHostName(); + if (retryPolicy.shouldRetry()) { + paramMap.put(restapiUrlString, retryString); + log.debug("retry attempt {} will use the retry url {}", retryPolicy.getRetryCount(), retryString); + sendRequest(paramMap, ctx, retryPolicy); } else { - log.debug("Maximum retries reached, calling setFailureResponseStatus."); + log.debug("Maximum retries reached, won't attempt to retry. Calling setFailureResponseStatus."); setFailureResponseStatus(ctx, prefix, e.getMessage(), r); } } catch (Exception ex) { - log.error("Could not attempt retry.", ex); - String retryErrorMessage = - "Retry attempt has failed. No further retry shall be attempted, calling " + - "setFailureResponseStatus."; + String retryErrorMessage = "Retry attempt " + retryPolicy.getRetryCount() + "has failed with error message " + ex.getMessage(); setFailureResponseStatus(ctx, prefix, retryErrorMessage, r); } } @@ -407,6 +434,18 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } } + protected void handlePartner(Map paramMap) { + String partner = paramMap.get("partner"); + if (partner != null && partner.length() > 0) { + PartnerDetails details = partnerStore.get(partner); + paramMap.put(restapiUserKey, details.username); + paramMap.put(restapiPasswordKey, details.password); + if(paramMap.get(restapiUrlString) == null) { + paramMap.put(restapiUrlString, details.url); + } + } + } + protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) throws SvcLogicException { log.info("Building {} started", format); @@ -571,6 +610,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { .builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); client.register(oAuth1Feature); + } } else { if (p.authtype == AuthType.DIGEST) { @@ -636,13 +676,12 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { WebTarget webTarget = addAuthType(client, p).target(p.restapiUrl); - log.info("Sending request:"); + log.info("Sending request below to url " + p.restapiUrl); log.info(request); long t1 = System.currentTimeMillis(); HttpResponse r = new HttpResponse(); r.code = 200; - String accept = p.accept; if(accept == null) { accept = p.format == Format.XML ? "application/xml" : "application/json"; diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java index 54c86fefc..65684d937 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java @@ -21,40 +21,41 @@ */ package org.onap.ccsdk.sli.plugins.restapicall; - public class RetryPolicy { private String[] hostnames; private Integer maximumRetries; - - public RetryPolicy(String[] hostnames, Integer maximumRetries){ - this.hostnames = hostnames; - this.maximumRetries = maximumRetries; + + private int position; + + private int retryCount; + public RetryPolicy(String[] hostnames, Integer maximumRetries) { + this.hostnames = hostnames; + this.maximumRetries = maximumRetries; + + this.position = 0; + + this.retryCount = 0; } - public Integer getMaximumRetries() { - return maximumRetries; + return maximumRetries; + } + public int getRetryCount() { + return retryCount; + } + public Boolean shouldRetry() { + return retryCount < maximumRetries + 1; + } + public String getRetryMessage() { + return retryCount + " retry attempts were made out of " + maximumRetries + " maximum retry attempts."; } - public String getNextHostName(String uri) throws RetryException { - Integer position = null; - - for (int i = 0; i < hostnames.length; i++) { - if (uri.contains(hostnames[i])) { - position = i; - break; - } - } - - if(position == null){ - throw new RetryException("No match found for the provided uri[" + uri + "] " + - "so the next host name could not be retreived"); - } - position++; - - if (position > hostnames.length - 1) { - position = 0; - } - return hostnames[position]; + public String getNextHostName() throws RetryException { + retryCount++; + position++; + + if (position > hostnames.length - 1) { + position = 0; + } + return hostnames[position]; } - -} +} \ No newline at end of file diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java deleted file mode 100644 index f68b851d3..000000000 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicyStore.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * Modifications Copyright © 2018 IBM. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.ccsdk.sli.plugins.restapicall; - -import java.util.HashMap; - -public class RetryPolicyStore { - HashMap retryPolicies; - public String proxyServers; - - public RetryPolicyStore() { - retryPolicies = new HashMap<>(); - } - - public String getProxyServers() { - return proxyServers; - } - - public void setProxyServers(String admServers) { - this.proxyServers = admServers; - String[] adminServersArray = admServers.split(","); - RetryPolicy adminPortalRetry = new RetryPolicy(adminServersArray, adminServersArray.length); - retryPolicies.put("dme2proxy", adminPortalRetry); - } - - public RetryPolicy getRetryPolicy(String policyName) { - return (this.retryPolicies.get(policyName)); - } - -} diff --git a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java old mode 100644 new mode 100755 index bdf67dc45..0704d297a --- a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -21,16 +21,19 @@ package org.onap.ccsdk.sli.plugins.restapicall; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; -import java.net.URI; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + import java.util.HashMap; import java.util.Map; + import org.codehaus.jettison.json.JSONObject; import org.glassfish.grizzly.http.server.HttpServer; import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.glassfish.jersey.server.ResourceConfig; + import org.junit.Test; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; @@ -40,9 +43,9 @@ import org.slf4j.LoggerFactory; public class TestRestapiCallNode { + @SuppressWarnings("unused") private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); - @Test public void testDelete() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); @@ -64,7 +67,6 @@ public class TestRestapiCallNode { ctx.setAttribute("prop.name", "site1"); - Map p = new HashMap<>(); p.put("templateFileName", "src/test/resources/sdwan-site.json"); p.put("restapiUrl", "https://echo.getpostman.com/delete"); @@ -77,61 +79,6 @@ public class TestRestapiCallNode { rcn.sendRequest(p, ctx); } - @Test - public void testJsonSdwanVpnTopologyTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - ctx.setAttribute("prop.topology", "topoType"); - - ctx.setAttribute("prop.roles_length", "1"); - ctx.setAttribute("prop.roles[0]", "role1"); - - ctx.setAttribute("prop.siteAttachement_length", "2"); - - ctx.setAttribute("prop.siteAttachement[0].siteId", "site1"); - ctx.setAttribute("prop.siteAttachement[0].roles_length", "0"); - ctx.setAttribute("prop.siteAttachement[0].roles[0]", "role1"); - ctx.setAttribute("prop.siteAttachement[0].roles[1]", "role3"); - - ctx.setAttribute("prop.siteAttachement[1].siteId", "site2"); - ctx.setAttribute("prop.siteAttachement[1].roles_length", "1"); - ctx.setAttribute("prop.siteAttachement[1].roles[0]", "role2"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/sdwan-vpn-topology.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testJsonSdwanSiteTemplate() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - ctx.setAttribute("prop.name", "site1"); - - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/sdwan-site.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - @Test public void testJsonTemplate() throws SvcLogicException { SvcLogicContext ctx = new SvcLogicContext(); @@ -250,33 +197,6 @@ public class TestRestapiCallNode { rcn.sendRequest(p, ctx); } - @Test(expected = SvcLogicException.class) - public void testFormData() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); - ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); - - Map p = new HashMap<>(); - p.put("templateFileName", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://echo.getpostman.com"); - p.put("restapiUser", "user1"); - p.put("restapiPassword", "abc123"); - p.put("format", "json"); - p.put("httpMethod", "post"); - p.put("responsePrefix", "response"); - p.put("skipSending", "false"); - p.put("multipartFormData", "true"); - p.put("multipartFile", "src/test/resources/test-template.json"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } @Test(expected = SvcLogicException.class) public void testWithInvalidURI() throws SvcLogicException { @@ -525,202 +445,74 @@ public class TestRestapiCallNode { RestapiCallNode rcn = new RestapiCallNode(); rcn.sendRequest(p, ctx); } - - @Test - public void testDeleteOAuthType() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "basic"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeDigest() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "digest"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "oauth"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test - public void testDeleteAuthTypeNoneOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("oAuthSignatureMethod", "plainTEXT"); - p.put("oAuthVersion", "1.0"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - @Test - public void testDeleteAuthTypeNoneBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("restapiUser", "admin"); - p.put("restapiPassword", "admin123"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeOAuth() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "oauth"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeBasic() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "basic"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - - @Test(expected = SvcLogicException.class) - public void testInvalidDeleteAuthTypeDigest() throws SvcLogicException { - SvcLogicContext ctx = new SvcLogicContext(); - - Map p = new HashMap<>(); - p.put("restapiUrl", "https://echo.getpostman.com/delete"); - p.put("authType", "digest"); - p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3"); - p.put("oAuthConsumerSecret", "secret"); - p.put("httpMethod", "delete"); - p.put("format", "none"); - p.put("skipSending", "true"); - - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - } - + /* + * { + "partnerOne": { + "url": "http://localhost:7001" 4 http://uebsb93kcdc.it.att.com:3904", + "test": "/metrics" + }, + "partnerTwo": { + "url": "http://localhost:7002", + "user": "controller_user", + "password": "P@ssword", + "test": "/metrics" + }, + "partnerThree": { + "url": "http://localhost:7003", + "user": "controller_admin" + } +} + */ @Test - public void testMultipartFormData() throws SvcLogicException { - final ResourceConfig resourceConfig = new ResourceConfig( - MultipartServerMock.class, MultiPartFeature.class); - HttpServer server = GrizzlyHttpServerFactory.createHttpServer( - URI.create("http://localhost:8080/"),resourceConfig); + public void testPartners() throws Exception{ + String partnerTwoKey = "partnerTwo"; + String partnerTwoUsername = "controller_user"; + String partnerTwoPassword = "P@ssword"; - Map p = new HashMap<>(); - p.put("multipartFormData", "true"); - p.put("format", "none"); - p.put("multipartFile", "src/test/resources/test-template.json"); - p.put("restapiUrl", "http://localhost:8080/file-upload/upload"); - - SvcLogicContext ctx = new SvcLogicContext(); + System.setProperty("SDNC_CONFIG_DIR", "src/test/resources"); RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - assertThat(ctx.getAttribute("response-code"), is("200")); - assertThat(ctx.getAttribute("httpResponse"), is( "test-template.json")); - server.shutdownNow(); + assertNull(rcn.partnerStore.get("partnerOne")); + PartnerDetails details = rcn.partnerStore.get(partnerTwoKey); + assertEquals(partnerTwoUsername,details.username); + assertEquals(partnerTwoPassword,details.password); + assertNull(rcn.partnerStore.get("partnerThree")); + + //In this scenario the caller expects username, password and url to be picked up from the partners json + Map paramMap = new HashMap(); + paramMap.put("partner", partnerTwoKey); + rcn.handlePartner(paramMap ); + assertEquals(partnerTwoUsername,paramMap.get(rcn.restapiUserKey)); + assertEquals(partnerTwoPassword,paramMap.get(rcn.restapiPasswordKey)); + assertEquals("http://localhost:7002",paramMap.get(rcn.restapiUrlString)); + + //In this scenario the caller expects username, password and url to be picked up from the partners json + //the provided suffix will be appended to the default url from the partners json + paramMap = new HashMap(); + paramMap.put("partner", partnerTwoKey); + paramMap.put("restapiUrlSuffix", "/networking/v1/instance/3"); + rcn.handlePartner(paramMap); + Parameters p = new Parameters(); + RestapiCallNode.getParameters(paramMap, p); + assertEquals(partnerTwoUsername,p.restapiUser); + assertEquals(partnerTwoPassword,p.restapiPassword); + assertEquals("http://localhost:7002/networking/v1/instance/3",p.restapiUrl); } - + @Test - public void testCookieResponse() throws SvcLogicException { - final ResourceConfig resourceConfig = new ResourceConfig( - MockCookieAuthServer.class); - HttpServer server = GrizzlyHttpServerFactory.createHttpServer( - URI.create("http://localhost:8080/"),resourceConfig); - - Map p = new HashMap<>(); - p.put("format", "none"); - p.put("httpMethod", "get"); - p.put("restapiUrl", "http://localhost:8080/get-cookie/cookie"); - p.put("dumpHeaders", "true"); - - SvcLogicContext ctx = new SvcLogicContext(); - RestapiCallNode rcn = new RestapiCallNode(); - rcn.sendRequest(p, ctx); - assertThat(ctx.getAttribute("response-code"), is("200")); - assertThat(ctx.getAttribute("header.Set-Cookie"), is("cookieResponse=cookieValueInReturn;Version=1")); - server.shutdownNow(); + public void retryPolicyBean() throws Exception { + Integer retries = 3; + String first = "http://localhost:7001"; + String second = "http://localhost:7001"; + + RetryPolicy p = new RetryPolicy(new String[] {first,second}, retries); + assertEquals(retries,p.getMaximumRetries()); + assertNotNull(p.getRetryMessage()); + String next = p.getNextHostName(); + assertEquals(second,next); + assertEquals(1,p.getRetryCount()); + next = p.getNextHostName(); + assertEquals(first,next); + assertEquals(2,p.getRetryCount()); } @Test diff --git a/restapi-call-node/provider/src/test/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java new file mode 100755 index 000000000..50371278a --- /dev/null +++ b/restapi-call-node/provider/src/test/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -0,0 +1,511 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.plugins.restapicall; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestRestapiCallNode { + + @SuppressWarnings("unused") + private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); + + + @Test + public void testDelete() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteWithPayload() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + ctx.setAttribute("prop.name", "site1"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/sdwan-site.json"); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "3"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[1].clci", "clci"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[2].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testInvalidRepeatTimes() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "a"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testInvalidTemplatePath() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resourcess/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test(expected = SvcLogicException.class) + public void testWithoutSkipSending() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + + @Test(expected = SvcLogicException.class) + public void testWithInvalidURI() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1"); + ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/test-template.json"); + p.put("restapiUrl", "http://echo. getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "false"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testVpnJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testSiteJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + ctx.setAttribute("prop.l3vpn.site1_name", "10000000-0000-0000-0000-000000000002"); + ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); + ctx.setAttribute("prop.l3vpn.entry1-id", "1"); + ctx.setAttribute("prop.l3vpn.sna1_name", "10000000-0000-0000-0000-000000000004"); + ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); + ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b"); + ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1"); + ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2"); + ctx.setAttribute("prop.l3vpn.sna1_svlan", "100"); + ctx.setAttribute("prop.l3vpn.ac1_protocol", "static"); + ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24"); + ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4"); + + ctx.setAttribute("prop.l3vpn.site2_name", "10000000-0000-0000-0000-000000000005"); + ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); + ctx.setAttribute("prop.l3vpn.entry2-id", "1"); + ctx.setAttribute("prop.l3vpn.sna2_name", "10000000-0000-0000-0000-000000000007"); + ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); + ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c"); + ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.6"); + ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5"); + ctx.setAttribute("prop.l3vpn.sna2_svlan", "200"); + ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp"); + ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.7"); + ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l3smsitetemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testVrfJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.vrf1-id", "10000000-0000-0000-0000-000000000007"); + ctx.setAttribute("prop.l3vpn.vpn-policy1-id", "10000000-0000-0000-0000-000000000003"); + ctx.setAttribute("prop.l3vpn.pe1_id", "a8098c1a-f86e-11da-bd1a-00112444be1e"); + ctx.setAttribute("prop.l3vpn.vrf2-id", "10000000-0000-0000-0000-000000000009"); + ctx.setAttribute("prop.l3vpn.vpn-policy2-id", "10000000-0000-0000-0000-000000000006"); + ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l3smvrftemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vrf-attributes"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testDeleteVpnJsonTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap<>(); + //p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services" + + "/vpnservice=10000000-0000-0000-0000-000000000001"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "json"); + p.put("httpMethod", "delete"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testL2DciTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.dci-connects.id", "Id1"); + ctx.setAttribute("prop.dci-connects.name", "Name1"); + ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); + ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); + ctx.setAttribute("prop.dci-connects.vni", "1"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l2-dci-connects-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testL3DciTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.dci-connects.id", "Id1"); + ctx.setAttribute("prop.dci-connects.name", "Name1"); + ctx.setAttribute("prop.dci-connects.local_networks_length", "2"); + ctx.setAttribute("prop.dci-connects.local_networks[0]", "NetId1"); + ctx.setAttribute("prop.dci-connects.local_networks[1]", "NetId2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[0]", "100:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[0]", "100:2"); + ctx.setAttribute("prop.dci-connects.evpn_irts[1]", "200:1"); + ctx.setAttribute("prop.dci-connects.evpn_erts[1]", "200:2"); + ctx.setAttribute("prop.dci-connects.vni", "1"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l3-dci-connects-template.json"); + p.put("restapiUrl", "http://echo.getpostman.com"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "abc123"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "response"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + + } + + @Test + public void testControllerTokenTemplate() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.user", "admin"); + ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.password", "admin123"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/actokentemplate.json"); + p.put("restapiUrl", "https://ipwan:18002/controller/v2/tokens"); + p.put("format", "json"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + + @Test + public void testDeleteNoneAsContentType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + + Map p = new HashMap<>(); + p.put("restapiUrl", "https://echo.getpostman.com/delete"); + p.put("restapiUser", "user1"); + p.put("restapiPassword", "pwd1"); + p.put("httpMethod", "delete"); + p.put("format", "none"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + + @Test + public void testPostNoneAsContentType() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("prop.l3vpn.name", "10000000-0000-0000-0000-000000000001"); + ctx.setAttribute("prop.l3vpn.topology", "point_to_point"); + + Map p = new HashMap<>(); + p.put("templateFileName", "src/test/resources/l3smvpntemplate.json"); + p.put("restapiUrl", "http://ipwan:18002/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services"); + p.put("restapiUser", "admin"); + p.put("restapiPassword", "admin123"); + p.put("format", "none"); + p.put("httpMethod", "post"); + p.put("responsePrefix", "restapi-result"); + p.put("skipSending", "true"); + + RestapiCallNode rcn = new RestapiCallNode(); + rcn.sendRequest(p, ctx); + } + /* + * { + "partnerOne": { + "url": "http://localhost:7001" 4 http://uebsb93kcdc.it.att.com:3904", + "test": "/metrics" + }, + "partnerTwo": { + "url": "http://localhost:7002", + "user": "controller_user", + "password": "P@ssword", + "test": "/metrics" + }, + "partnerThree": { + "url": "http://localhost:7003", + "user": "controller_admin" + } +} + */ + @Test + public void testPartners() throws Exception{ + String partnerTwoKey = "partnerTwo"; + String partnerTwoUsername = "controller_user"; + String partnerTwoPassword = "P@ssword"; + + System.setProperty("SDNC_CONFIG_DIR", "src/test/resources"); + RestapiCallNode rcn = new RestapiCallNode(); + assertNull(rcn.partnerStore.get("partnerOne")); + PartnerDetails details = rcn.partnerStore.get(partnerTwoKey); + assertEquals(partnerTwoUsername,details.username); + assertEquals(partnerTwoPassword,details.password); + assertNull(rcn.partnerStore.get("partnerThree")); + + //In this scenario the caller expects username, password and url to be picked up from the partners json + Map paramMap = new HashMap(); + paramMap.put("partner", partnerTwoKey); + rcn.handlePartner(paramMap ); + assertEquals(partnerTwoUsername,paramMap.get(rcn.restapiUserKey)); + assertEquals(partnerTwoPassword,paramMap.get(rcn.restapiPasswordKey)); + assertEquals("http://localhost:7002",paramMap.get(rcn.restapiUrlString)); + + //In this scenario the caller expects username, password and url to be picked up from the partners json + //the provided suffix will be appended to the default url from the partners json + paramMap = new HashMap(); + paramMap.put("partner", partnerTwoKey); + paramMap.put("restapiUrlSuffix", "/networking/v1/instance/3"); + rcn.handlePartner(paramMap); + Parameters p = new Parameters(); + RestapiCallNode.getParameters(paramMap, p); + assertEquals(partnerTwoUsername,p.restapiUser); + assertEquals(partnerTwoPassword,p.restapiPassword); + assertEquals("http://localhost:7002/networking/v1/instance/3",p.restapiUrl); + } + + @Test + public void retryPolicyBean() throws Exception { + Integer retries = 3; + String first = "http://localhost:7001"; + String second = "http://localhost:7001"; + + RetryPolicy p = new RetryPolicy(new String[] {first,second}, retries); + assertEquals(retries,p.getMaximumRetries()); + assertNotNull(p.getRetryMessage()); + String next = p.getNextHostName(); + assertEquals(second,next); + assertEquals(1,p.getRetryCount()); + next = p.getNextHostName(); + assertEquals(first,next); + assertEquals(2,p.getRetryCount()); + } +} diff --git a/restapi-call-node/provider/src/test/resources/partners.json b/restapi-call-node/provider/src/test/resources/partners.json new file mode 100755 index 000000000..9a17a1acf --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/partners.json @@ -0,0 +1,16 @@ +{ + "partnerOne": { + "url": "http://localhost:7001", + "test": "/metrics" + }, + "partnerTwo": { + "url": "http://localhost:7002", + "user": "controller_user", + "password": "P@ssword", + "test": "/metrics" + }, + "partnerThree": { + "url": "http://localhost:7003", + "user": "controller_admin" + } +} diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java index ac0897e8f..620df282f 100644 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java @@ -46,8 +46,6 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; import org.onap.ccsdk.sli.plugins.restapicall.Format; import org.onap.ccsdk.sli.plugins.restapicall.HttpResponse; import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; -import org.onap.ccsdk.sli.plugins.restapicall.RetryException; -import org.onap.ccsdk.sli.plugins.restapicall.RetryPolicy; import org.onap.ccsdk.sli.plugins.restapicall.XmlParser; import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DataFormatSerializer; import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DataFormatSerializerContext; @@ -165,14 +163,9 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { public void sendRequest(Map paramMap, SvcLogicContext ctx, Integer retryCount) throws SvcLogicException { RestapiCallNode rest = getRestapiCallNode(); - RetryPolicy retryPolicy = null; HttpResponse r = new HttpResponse(); try { YangParameters p = getYangParameters(paramMap); - if (p.partner != null) { - retryPolicy = rest.getRetryPolicyStore() - .getRetryPolicy(p.partner); - } String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; Map props = new HashMap<>((Map)ctx.toProperties()); @@ -215,30 +208,7 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { log.error(REQ_ERR + e.getMessage(), e); String prefix = parseParam(paramMap, RES_PRE, false, null); - if (retryPolicy == null || !shouldRetry) { - setFailureResponseStatus(ctx, prefix, e.getMessage()); - } else { - if (retryCount == null) { - retryCount = 0; - } - log.debug(format(ATTEMPTS_MSG, retryCount, - retryPolicy.getMaximumRetries())); - try { - retryCount = retryCount + 1; - if (retryCount < retryPolicy.getMaximumRetries() + 1) { - setRetryUri(paramMap, retryPolicy); - log.debug(format(RETRY_COUNT, retryCount, retryPolicy - .getMaximumRetries())); - sendRequest(paramMap, ctx, retryCount); - } else { - log.debug(MAX_RETRY_ERR); - setFailureResponseStatus(ctx, prefix, e.getMessage()); - } - } catch (Exception ex) { - log.error(NO_MORE_RETRY, ex); - setFailureResponseStatus(ctx, prefix, RETRY_FAIL); - } - } + setFailureResponseStatus(ctx, prefix, e.getMessage()); } if (r != null && r.code >= 300) { @@ -402,31 +372,6 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { ctx.setAttribute(prefix + RES_MSG, res.message); } - /** - * Sets the retry URI to the param map from the retry policies different - * host. - * - * @param paramMap parameter map - * @param retryPolicy retry policy - * @throws URISyntaxException when new URI creation fails - * @throws RetryException when retry policy cannot give another host - */ - private void setRetryUri(Map paramMap, - RetryPolicy retryPolicy) - throws URISyntaxException, RetryException { - URI uri = new URI(paramMap.get(REST_API_URL)); - String hostName = uri.getHost(); - String retryString = retryPolicy.getNextHostName(uri.toString()); - - URI uriTwo = new URI(retryString); - URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port( - uriTwo.getPort()).scheme(uriTwo.getScheme()).build(); - - paramMap.put(REST_API_URL, retryUri.toString()); - log.debug(UPDATED_URL + retryUri.toString()); - log.debug(format(COMM_FAIL, hostName, retryString)); - } - /** * Updates request message for JSON and XML data format, when the HTTP * method points it as PUT or PATCH. -- cgit 1.2.3-korg From b43008aa2dce75efdf704d1a5e2529e58b4fbde1 Mon Sep 17 00:00:00 2001 From: Stan Bonev Date: Fri, 7 Jun 2019 14:31:33 -0400 Subject: Remove logging passwords in clear text Change-Id: I21c70038bc19c3bab137fc9604b7b593b6d529e1 Issue-ID: CCSDK-1385 Signed-off-by: Stan Bonev --- .../ccsdk/sli/plugins/prop/PropertiesNode.java | 66 +-- .../sli/plugins/restapicall/RestapiCallNode.java | 451 ++++++++++++--------- 2 files changed, 305 insertions(+), 212 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java b/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java index 612592b58..f0c7e0b45 100644 --- a/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java +++ b/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java @@ -8,9 +8,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,7 +29,6 @@ import java.util.HashSet; import java.util.Map; import java.util.Properties; import java.util.Set; - import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; @@ -45,10 +44,10 @@ public class PropertiesNode implements SvcLogicJavaPlugin { Properties prop = new Properties(); try { File file = new File(param.fileName); - try(InputStream in = new FileInputStream(file)){ + try (InputStream in = new FileInputStream(file)) { Map mm = null; String pfx = param.contextPrefix != null ? param.contextPrefix + '.' : ""; - if(param.fileBasedParsing){ + if (param.fileBasedParsing) { byte[] data = new byte[(int) file.length()]; if ("json".equalsIgnoreCase(getFileExtension(param.fileName))) { in.read(data); @@ -65,14 +64,15 @@ public class PropertiesNode implements SvcLogicJavaPlugin { String value = prop.getProperty(name); if (value != null && value.trim().length() > 0) { ctx.setAttribute(pfx + name, value.trim()); - log.info("+++ " + pfx + name + ": [" + value + "]"); + log.info("+++ " + pfx + name + ": [" + maskPassword(pfx + name, value) + "]"); } } } - if (mm != null){ - for (Map.Entry entry : mm.entrySet()){ + if (mm != null) { + for (Map.Entry entry : mm.entrySet()) { ctx.setAttribute(pfx + entry.getKey(), entry.getValue()); - log.info("+++ " + pfx + entry.getKey() + ": [" + entry.getValue() + "]"); + log.info("+++ " + pfx + entry.getKey() + ": [" + + maskPassword(pfx + entry.getKey(), entry.getValue()) + "]"); } } } else { @@ -82,7 +82,7 @@ public class PropertiesNode implements SvcLogicJavaPlugin { String value = prop.getProperty(name); if (value != null && value.trim().length() > 0) { ctx.setAttribute(pfx + name, value.trim()); - log.info("+++ " + pfx + name + ": [" + value + "]"); + log.info("+++ " + pfx + name + ": [" + maskPassword(pfx + name, value) + "]"); } } } @@ -92,17 +92,16 @@ public class PropertiesNode implements SvcLogicJavaPlugin { } } - /* Getting extension has to do the following - * "" --> "" - * "name" --> "" - * "name.txt" --> "txt" - * ".htpasswd" --> "" - * "name.with.many.dots.myext" --> "myext" - */ + /* + * Getting extension has to do the following "" --> "" "name" --> "" "name.txt" --> "txt" + * ".htpasswd" --> "" "name.with.many.dots.myext" --> "myext" + */ private static String getFileExtension(String fileName) { - if(fileName.lastIndexOf(".") != -1 && fileName.lastIndexOf(".") != 0) - return fileName.substring(fileName.lastIndexOf(".")+1); - else return ""; + if (fileName.lastIndexOf(".") != -1 && fileName.lastIndexOf(".") != 0) { + return fileName.substring(fileName.lastIndexOf(".") + 1); + } else { + return ""; + } } protected Parameters getParameters(Map paramMap) throws SvcLogicException { @@ -117,9 +116,11 @@ public class PropertiesNode implements SvcLogicJavaPlugin { protected Set getListNameList(Map paramMap) { Set ll = new HashSet<>(); - for (Map.Entry entry : paramMap.entrySet()) - if (entry.getKey().startsWith("listName")) + for (Map.Entry entry : paramMap.entrySet()) { + if (entry.getKey().startsWith("listName")) { ll.add(entry.getValue()); + } + } return ll; } @@ -128,8 +129,9 @@ public class PropertiesNode implements SvcLogicJavaPlugin { String s = paramMap.get(name); if (s == null || s.trim().length() == 0) { - if (!required) + if (!required) { return def; + } throw new SvcLogicException("Parameter " + name + " is required in PropertiesNode"); } @@ -139,13 +141,15 @@ public class PropertiesNode implements SvcLogicJavaPlugin { int i1 = s.indexOf('%'); while (i1 >= 0) { int i2 = s.indexOf('%', i1 + 1); - if (i2 < 0) + if (i2 < 0) { throw new SvcLogicException("Cannot parse parameter " + name + ": " + s + ": no matching %"); + } String varName = s.substring(i1 + 1, i2); String varValue = System.getenv(varName); - if (varValue == null) + if (varValue == null) { varValue = ""; + } value += s.substring(i, i1); value += varValue; @@ -155,7 +159,17 @@ public class PropertiesNode implements SvcLogicJavaPlugin { } value += s.substring(i); - log.info("Parameter " + name + ": " + value); + log.info("Parameter " + name + ": " + maskPassword(name, value)); + return value; + } + + private static Object maskPassword(String name, Object value) { + String[] pwdNames = {"pwd", "passwd", "password", "Pwd", "Passwd", "Password"}; + for (String pwdName : pwdNames) { + if (name.contains(pwdName)) { + return "**********"; + } + } return value; } } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 34e5dec21..adf723b8b 100755 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -57,8 +57,6 @@ import javax.ws.rs.core.Feature; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; @@ -70,8 +68,6 @@ import org.glassfish.jersey.client.oauth1.OAuth1ClientSupport; import org.glassfish.jersey.media.multipart.MultiPart; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; -import org.glassfish.jersey.client.oauth1.ConsumerCredentials; -import org.glassfish.jersey.client.oauth1.OAuth1ClientSupport; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; @@ -98,14 +94,14 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { protected static final String restapiUserKey = "restapiUser"; protected static final String restapiPasswordKey = "restapiPassword"; - protected HashMap partnerStore; + protected HashMap partnerStore; public RestapiCallNode() { - String configDir = System.getProperty(PROPERTIES_DIR_KEY, DEFAULT_PROPERTIES_DIR); + String configDir = System.getProperty(PROPERTIES_DIR_KEY, DEFAULT_PROPERTIES_DIR); try { String jsonString = readFile(configDir + "/" + PARTNERS_FILE_NAME); JSONObject partners = new JSONObject(jsonString); - partnerStore = new HashMap(); + partnerStore = new HashMap<>(); loadPartners(partners); log.info("Partners support enabled"); } catch (Exception e) { @@ -123,103 +119,81 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } protected void loadPartners(JSONObject partners) { - Iterator keys = partners.keys(); - String partnerUserKey = "user"; - String partnerPasswordKey = "password"; - String partnerUrlKey = "url"; - - while (keys.hasNext()) { - String partnerKey = keys.next(); - try { - JSONObject partnerObject = (JSONObject) partners.get(partnerKey); - if (partnerObject.has(partnerUserKey) && partnerObject.has(partnerPasswordKey)) { - String url = null; - if (partnerObject.has(partnerUrlKey)) { - url = partnerObject.getString(partnerUrlKey); - } - String userName = partnerObject.getString(partnerUserKey); - String password = partnerObject.getString(partnerPasswordKey); - PartnerDetails details = new PartnerDetails(userName, password, url); - partnerStore.put(partnerKey, details); - log.info("mapped partner using partner key " + partnerKey); - } else { - log.info("Partner " + partnerKey + " is missing required keys, it won't be mapped"); - } - } catch (JSONException e) { - log.info("Couldn't map the partner using partner key " + partnerKey, e); - } - } + Iterator keys = partners.keys(); + String partnerUserKey = "user"; + String partnerPasswordKey = "password"; + String partnerUrlKey = "url"; + + while (keys.hasNext()) { + String partnerKey = keys.next(); + try { + JSONObject partnerObject = (JSONObject) partners.get(partnerKey); + if (partnerObject.has(partnerUserKey) && partnerObject.has(partnerPasswordKey)) { + String url = null; + if (partnerObject.has(partnerUrlKey)) { + url = partnerObject.getString(partnerUrlKey); + } + String userName = partnerObject.getString(partnerUserKey); + String password = partnerObject.getString(partnerPasswordKey); + PartnerDetails details = new PartnerDetails(userName, password, url); + partnerStore.put(partnerKey, details); + log.info("mapped partner using partner key " + partnerKey); + } else { + log.info("Partner " + partnerKey + " is missing required keys, it won't be mapped"); + } + } catch (JSONException e) { + log.info("Couldn't map the partner using partner key " + partnerKey, e); + } + } } /** * Returns parameters from the parameter map. * * @param paramMap parameter map - * @param p parameters instance + * @param p parameters instance * @return parameters filed instance * @throws SvcLogicException when svc logic exception occurs */ - public static Parameters getParameters(Map paramMap, - Parameters p) - throws SvcLogicException { + public static Parameters getParameters(Map paramMap, Parameters p) throws SvcLogicException { - p.templateFileName = parseParam(paramMap, "templateFileName", - false, null); + p.templateFileName = parseParam(paramMap, "templateFileName", false, null); p.requestBody = parseParam(paramMap, "requestBody", false, null); p.restapiUrl = parseParam(paramMap, restapiUrlString, true, null); validateUrl(p.restapiUrl); - p.restapiUrlSuffix = parseParam(paramMap, "restapiUrlSuffix", - false, null); + p.restapiUrlSuffix = parseParam(paramMap, "restapiUrlSuffix", false, null); p.restapiUser = parseParam(paramMap, restapiUserKey, false, null); - p.restapiPassword = parseParam(paramMap, restapiPasswordKey, false, - null); - if(p.restapiUrlSuffix != null) { + p.restapiPassword = parseParam(paramMap, restapiPasswordKey, false, null); + if (p.restapiUrlSuffix != null) { p.restapiUrl = p.restapiUrl + p.restapiUrlSuffix; validateUrl(p.restapiUrl); } - p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", - false, null); - p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", - false, null); - p.oAuthSignatureMethod = parseParam(paramMap, "oAuthSignatureMethod", - false, null); + p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", false, null); + p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", false, null); + p.oAuthSignatureMethod = parseParam(paramMap, "oAuthSignatureMethod", false, null); p.oAuthVersion = parseParam(paramMap, "oAuthVersion", false, null); p.contentType = parseParam(paramMap, "contentType", false, null); - p.format = Format.fromString(parseParam(paramMap, "format", false, - "json")); - p.authtype = fromString(parseParam(paramMap, "authType", false, - "unspecified")); - p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", - false, "post")); + p.format = Format.fromString(parseParam(paramMap, "format", false, "json")); + p.authtype = fromString(parseParam(paramMap, "authType", false, "unspecified")); + p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post")); p.responsePrefix = parseParam(paramMap, responsePrefix, false, null); p.listNameList = getListNameList(paramMap); String skipSendingStr = paramMap.get(skipSendingMessage); p.skipSending = "true".equalsIgnoreCase(skipSendingStr); - p.convertResponse = valueOf(parseParam(paramMap, "convertResponse", - false, "true")); - p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", - false, null); - p.trustStorePassword = parseParam(paramMap, "trustStorePassword", - false, null); - p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", - false, null); - p.keyStorePassword = parseParam(paramMap, "keyStorePassword", - false, null); - p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null - && p.keyStoreFileName != null && p.keyStorePassword != null; - p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", - false, null); + p.convertResponse = valueOf(parseParam(paramMap, "convertResponse", false, "true")); + p.trustStoreFileName = parseParam(paramMap, "trustStoreFileName", false, null); + p.trustStorePassword = parseParam(paramMap, "trustStorePassword", false, null); + p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", false, null); + p.keyStorePassword = parseParam(paramMap, "keyStorePassword", false, null); + p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null && p.keyStoreFileName != null + && p.keyStorePassword != null; + p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null); p.partner = parseParam(paramMap, "partner", false, null); - p.dumpHeaders = valueOf(parseParam(paramMap, "dumpHeaders", - false, null)); - p.returnRequestPayload = valueOf(parseParam( - paramMap, "returnRequestPayload", false, null)); - p.accept = parseParam(paramMap, "accept", - false, null); - p.multipartFormData = valueOf(parseParam(paramMap, "multipartFormData", - false, "false")); - p.multipartFile = parseParam(paramMap, "multipartFile", - false, null); + p.dumpHeaders = valueOf(parseParam(paramMap, "dumpHeaders", false, null)); + p.returnRequestPayload = valueOf(parseParam(paramMap, "returnRequestPayload", false, null)); + p.accept = parseParam(paramMap, "accept", false, null); + p.multipartFormData = valueOf(parseParam(paramMap, "multipartFormData", false, "false")); + p.multipartFile = parseParam(paramMap, "multipartFile", false, null); return p; } @@ -230,18 +204,18 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { * @throws SvcLogicException when URL validation fails */ private static void validateUrl(String restapiUrl) throws SvcLogicException { - if (restapiUrl.contains(",")) { - String[] urls = restapiUrl.split(","); - for(String url : urls) { - validateUrl(url); - } - } else { - try { - URI.create(restapiUrl); - } catch (IllegalArgumentException e) { - throw new SvcLogicException("Invalid input of url " + e.getLocalizedMessage(), e); - } - } + if (restapiUrl.contains(",")) { + String[] urls = restapiUrl.split(","); + for (String url : urls) { + validateUrl(url); + } + } else { + try { + URI.create(restapiUrl); + } catch (IllegalArgumentException e) { + throw new SvcLogicException("Invalid input of url " + e.getLocalizedMessage(), e); + } + } } /** @@ -261,19 +235,18 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } /** - * Parses the parameter string map of property, validates if required, - * assigns default value if present and returns the value. + * Parses the parameter string map of property, validates if required, assigns default value if + * present and returns the value. * * @param paramMap string param map - * @param name name of the property + * @param name name of the property * @param required if value required - * @param def default value + * @param def default value * @return value of the property * @throws SvcLogicException if required parameter value is empty */ - public static String parseParam(Map paramMap, String name, - boolean required, String def) - throws SvcLogicException { + public static String parseParam(Map paramMap, String name, boolean required, String def) + throws SvcLogicException { String s = paramMap.get(name); if (s == null || s.trim().length() == 0) { @@ -307,37 +280,148 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } value.append(s.substring(i)); - log.info("Parameter {}: [{}]", name, value); + log.info("Parameter {}: [{}]", name, maskPassword(name, value)); + return value.toString(); } + private static Object maskPassword(String name, Object value) { + String[] pwdNames = {"pwd", "passwd", "password", "Pwd", "Passwd", "Password"}; + for (String pwdName : pwdNames) { + if (name.contains(pwdName)) { + return "**********"; + } + } + return value; + } + /** - * Allows Directed Graphs the ability to interact with REST APIs. + * Allows Directed Graphs the ability to interact with REST APIs. + * * @param paramMap HashMap of parameters passed by the DG to this function - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * vpn-information.vrf-details - * - * - * - * - * - * - * - *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to template file that can be used to build a request/sdncopt/bvc/restapi/templates/vnf_service-configuration-operation_minimal.json
restapiUrlMandatoryurl to send the request tohttps://sdncodl:8543/restconf/operations/L3VNF-API:create-update-vnf-request
restapiUserOptionaluser name to use for http basic authenticationsdnc_ws
restapiPasswordOptionalunencrypted password to use for http basic authenticationplain_password
oAuthConsumerKeyOptionalConsumer key to use for http oAuth authenticationplain_key
oAuthConsumerSecretOptionalConsumer secret to use for http oAuth authenticationplain_secret
oAuthSignatureMethodOptionalConsumer method to use for http oAuth authenticationmethod
oAuthVersionOptionalVersion http oAuth authenticationversion
contentTypeOptionalhttp content type to set in the http headerusually application/json or application/xml
formatOptionalshould match request body formatjson or xml
httpMethodOptionalhttp method to use when sending the requestget post put delete patch
responsePrefixOptionallocation the response will be written to in context memorytmp.restapi.result
listName[i]OptionalUsed for processing XML responses with repeating elements.
skipSendingOptionaltrue or false
convertResponse Optionalwhether the response should be convertedtrue or false
customHttpHeadersOptionala list additional http headers to be passed in, follow the format in the exampleX-CSI-MessageId=messageId,headerFieldName=headerFieldValue
dumpHeadersOptionalwhen true writes http header content to context memorytrue or false
partnerOptionalused to retrieve username, password and url if partner store existsaaf
returnRequestPayloadOptionalused to return payload built in the requesttrue or false
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * vpn-information.vrf-details + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
parameterMandatory/Optionaldescriptionexample values
templateFileNameOptionalfull path to template file that can be used to build a request/sdncopt/bvc/restapi/templates/vnf_service-configuration-operation_minimal.json
restapiUrlMandatoryurl to send the request tohttps://sdncodl:8543/restconf/operations/L3VNF-API:create-update-vnf-request
restapiUserOptionaluser name to use for http basic authenticationsdnc_ws
restapiPasswordOptionalunencrypted password to use for http basic authenticationplain_password
oAuthConsumerKeyOptionalConsumer key to use for http oAuth authenticationplain_key
oAuthConsumerSecretOptionalConsumer secret to use for http oAuth authenticationplain_secret
oAuthSignatureMethodOptionalConsumer method to use for http oAuth authenticationmethod
oAuthVersionOptionalVersion http oAuth authenticationversion
contentTypeOptionalhttp content type to set in the http headerusually application/json or application/xml
formatOptionalshould match request body formatjson or xml
httpMethodOptionalhttp method to use when sending the requestget post put delete patch
responsePrefixOptionallocation the response will be written to in context memorytmp.restapi.result
listName[i]OptionalUsed for processing XML responses with repeating + * elements.
skipSendingOptionaltrue or false
convertResponseOptionalwhether the response should be convertedtrue or false
customHttpHeadersOptionala list additional http headers to be passed in, follow the format in the exampleX-CSI-MessageId=messageId,headerFieldName=headerFieldValue
dumpHeadersOptionalwhen true writes http header content to context memorytrue or false
partnerOptionalused to retrieve username, password and url if partner store existsaaf
returnRequestPayloadOptionalused to return payload built in the requesttrue or false
* @param ctx Reference to context memory * @throws SvcLogicException * @since 11.0.2 @@ -348,16 +432,16 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } protected void sendRequest(Map paramMap, SvcLogicContext ctx, RetryPolicy retryPolicy) - throws SvcLogicException { + throws SvcLogicException { HttpResponse r = new HttpResponse(); try { - handlePartner(paramMap); + handlePartner(paramMap); Parameters p = getParameters(paramMap, new Parameters()); - if(p.restapiUrl.contains(",") && retryPolicy == null) { - String[] urls = p.restapiUrl.split(","); - retryPolicy = new RetryPolicy(urls,urls.length * 2); - p.restapiUrl = urls[0]; + if (p.restapiUrl.contains(",") && retryPolicy == null) { + String[] urls = p.restapiUrl.split(","); + retryPolicy = new RetryPolicy(urls, urls.length * 2); + p.restapiUrl = urls[0]; } String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; @@ -412,18 +496,20 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } else { log.debug(retryPolicy.getRetryMessage()); try { - //calling getNextHostName increments the retry count so it should be called before shouldRetry + // calling getNextHostName increments the retry count so it should be called before shouldRetry String retryString = retryPolicy.getNextHostName(); if (retryPolicy.shouldRetry()) { paramMap.put(restapiUrlString, retryString); - log.debug("retry attempt {} will use the retry url {}", retryPolicy.getRetryCount(), retryString); + log.debug("retry attempt {} will use the retry url {}", retryPolicy.getRetryCount(), + retryString); sendRequest(paramMap, ctx, retryPolicy); } else { log.debug("Maximum retries reached, won't attempt to retry. Calling setFailureResponseStatus."); setFailureResponseStatus(ctx, prefix, e.getMessage(), r); } } catch (Exception ex) { - String retryErrorMessage = "Retry attempt " + retryPolicy.getRetryCount() + "has failed with error message " + ex.getMessage(); + String retryErrorMessage = "Retry attempt " + retryPolicy.getRetryCount() + + "has failed with error message " + ex.getMessage(); setFailureResponseStatus(ctx, prefix, retryErrorMessage, r); } } @@ -436,18 +522,17 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { protected void handlePartner(Map paramMap) { String partner = paramMap.get("partner"); - if (partner != null && partner.length() > 0) { - PartnerDetails details = partnerStore.get(partner); - paramMap.put(restapiUserKey, details.username); - paramMap.put(restapiPasswordKey, details.password); - if(paramMap.get(restapiUrlString) == null) { - paramMap.put(restapiUrlString, details.url); - } - } + if (partner != null && partner.length() > 0) { + PartnerDetails details = partnerStore.get(partner); + paramMap.put(restapiUserKey, details.username); + paramMap.put(restapiPasswordKey, details.password); + if (paramMap.get(restapiUrlString) == null) { + paramMap.put(restapiUrlString, details.url); + } + } } - protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) - throws SvcLogicException { + protected String buildXmlJsonRequest(SvcLogicContext ctx, String template, Format format) throws SvcLogicException { log.info("Building {} started", format); long t1 = System.currentTimeMillis(); String originalTemplate = template; @@ -496,8 +581,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } } - String req = format == Format.XML - ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) : XmlJsonUtil.removeEmptyStructJson(originalTemplate, ss.toString()); + String req = format == Format.XML ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) + : XmlJsonUtil.removeEmptyStructJson(originalTemplate, ss.toString()); if (format == Format.JSON) { req = XmlJsonUtil.removeLastCommaJson(req); @@ -522,7 +607,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { int i2 = template.indexOf(':', i1 + 9); if (i2 < 0) { throw new SvcLogicException( - "Template error: Context variable name followed by : is required after repeat"); + "Template error: Context variable name followed by : is required after repeat"); } // Find the closing }, store in i3 @@ -604,11 +689,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (p.authtype == AuthType.Unspecified) { if (p.restapiUser != null && p.restapiPassword != null) { client.register(HttpAuthenticationFeature.basic(p.restapiUser, p.restapiPassword)); - } else if (p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null - && p.oAuthSignatureMethod != null) { - Feature oAuth1Feature = OAuth1ClientSupport - .builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) - .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); + } else if (p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null && p.oAuthSignatureMethod != null) { + Feature oAuth1Feature = + OAuth1ClientSupport.builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) + .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); client.register(oAuth1Feature); } @@ -618,27 +702,30 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { client.register(HttpAuthenticationFeature.digest(p.restapiUser, p.restapiPassword)); } else { throw new SvcLogicException( - "oAUTH authentication type selected but all restapiUser and restapiPassword " + - "parameters doesn't exist", new Throwable()); + "oAUTH authentication type selected but all restapiUser and restapiPassword " + + "parameters doesn't exist", + new Throwable()); } } else if (p.authtype == AuthType.BASIC) { if (p.restapiUser != null && p.restapiPassword != null) { client.register(HttpAuthenticationFeature.basic(p.restapiUser, p.restapiPassword)); } else { throw new SvcLogicException( - "oAUTH authentication type selected but all restapiUser and restapiPassword " + - "parameters doesn't exist", new Throwable()); + "oAUTH authentication type selected but all restapiUser and restapiPassword " + + "parameters doesn't exist", + new Throwable()); } } else if (p.authtype == AuthType.OAUTH) { if (p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null && p.oAuthSignatureMethod != null) { Feature oAuth1Feature = OAuth1ClientSupport - .builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) - .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); + .builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) + .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); client.register(oAuth1Feature); } else { throw new SvcLogicException( - "oAUTH authentication type selected but all oAuthConsumerKey, oAuthConsumerSecret " + - "and oAuthSignatureMethod parameters doesn't exist", new Throwable()); + "oAUTH authentication type selected but all oAuthConsumerKey, oAuthConsumerSecret " + + "and oAuthSignatureMethod parameters doesn't exist", + new Throwable()); } } } @@ -649,12 +736,11 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { * Receives the http response for the http request sent. * * @param request request msg - * @param p parameters + * @param p parameters * @return HTTP response * @throws SvcLogicException when sending http request fails */ - public HttpResponse sendHttpRequest(String request, Parameters p) - throws SvcLogicException { + public HttpResponse sendHttpRequest(String request, Parameters p) throws SvcLogicException { SSLContext ssl = null; if (p.ssl && p.restapiUrl.startsWith("https")) { @@ -664,11 +750,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (ssl != null) { HttpsURLConnection.setDefaultSSLSocketFactory(ssl.getSocketFactory()); - client = ClientBuilder.newBuilder().sslContext(ssl).hostnameVerifier((s, sslSession) -> true) - .build(); + client = ClientBuilder.newBuilder().sslContext(ssl).hostnameVerifier((s, sslSession) -> true).build(); } else { - client = ClientBuilder.newBuilder().hostnameVerifier((s, sslSession) -> true) - .build(); + client = ClientBuilder.newBuilder().hostnameVerifier((s, sslSession) -> true).build(); } client.property(ClientProperties.CONNECT_TIMEOUT, 5000); // Needed to support additional HTTP methods such as PATCH @@ -683,12 +767,12 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { HttpResponse r = new HttpResponse(); r.code = 200; String accept = p.accept; - if(accept == null) { + if (accept == null) { accept = p.format == Format.XML ? "application/xml" : "application/json"; } String contentType = p.contentType; - if(contentType == null) { + if (contentType == null) { contentType = accept + ";charset=UTF-8"; } @@ -705,7 +789,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { for (String singlePair : keyValuePairs) { int equalPosition = singlePair.indexOf('='); invocationBuilder.header(singlePair.substring(0, equalPosition), - singlePair.substring(equalPosition + 1, singlePair.length())); + singlePair.substring(equalPosition + 1, singlePair.length())); } } @@ -718,8 +802,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { try { response = invocationBuilder.method(p.httpMethod.toString(), entity(request, contentType)); } catch (ProcessingException | IllegalStateException e) { - throw new SvcLogicException(requestPostingException + - e.getLocalizedMessage(), e); + throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } r.code = response.getStatus(); @@ -738,9 +821,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { MultiPart multiPart = new MultiPart(); multiPart.setMediaType(MediaType.MULTIPART_FORM_DATA_TYPE); - FileDataBodyPart fileDataBodyPart = new FileDataBodyPart("file", - new File(p.multipartFile), - MediaType.APPLICATION_OCTET_STREAM_TYPE); + FileDataBodyPart fileDataBodyPart = + new FileDataBodyPart("file", new File(p.multipartFile), MediaType.APPLICATION_OCTET_STREAM_TYPE); multiPart.bodyPart(fileDataBodyPart); @@ -764,10 +846,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { Response response; try { - response = invocationBuilder.method(p.httpMethod.toString(), entity(multiPart, multiPart.getMediaType())); + response = + invocationBuilder.method(p.httpMethod.toString(), entity(multiPart, multiPart.getMediaType())); } catch (ProcessingException | IllegalStateException e) { - throw new SvcLogicException(requestPostingException + - e.getLocalizedMessage(), e); + throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } r.code = response.getStatus(); @@ -816,7 +898,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } protected void setFailureResponseStatus(SvcLogicContext ctx, String prefix, String errorMessage, - HttpResponse resp) { + HttpResponse resp) { resp.code = 500; resp.message = errorMessage; String pp = prefix != null ? prefix + '.' : ""; @@ -939,8 +1021,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { throw new SvcLogicException("Http operation" + p.httpMethod + "not supported"); } } catch (ProcessingException e) { - throw new SvcLogicException(requestPostingException + - e.getLocalizedMessage(), e); + throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } r.code = response.getStatus(); @@ -958,7 +1039,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { log.info("Got response code 301. Sending same request to URL: {}", newUrl); - webTarget = client.target(newUrl); + webTarget = client.target(newUrl); invocationBuilder = webTarget.request(tt).accept(tt); try { @@ -970,8 +1051,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { throw new SvcLogicException("Http operation" + p.httpMethod + "not supported"); } } catch (ProcessingException e) { - throw new SvcLogicException(requestPostingException + - e.getLocalizedMessage(), e); + throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } r.code = response.getStatus(); @@ -1068,8 +1148,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { try { response = invocationBuilder.post(Entity.entity(request, tt1)); } catch (ProcessingException e) { - throw new SvcLogicException(requestPostingException + - e.getLocalizedMessage(), e); + throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } r.code = response.getStatus(); r.headers = response.getStringHeaders(); -- cgit 1.2.3-korg From bd8a4d04337eed46be669f70272e6583f48ba249 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 21 Jun 2019 17:22:27 -0400 Subject: Remove versions from project poms Remove versions from project poms and instead drive version from dependencyManagement to ensure consistency. Change-Id: I2a3238163e49878c4c7528db1271c83b488263c3 Issue-ID: CCSDK-1416 Signed-off-by: Timoney, Dan (dt5972) --- grToolkit/provider/pom.xml | 4 ---- restapi-call-node/provider/pom.xml | 7 ------- restconf-client/provider/pom.xml | 19 ++++++------------- sshapi-call-node/provider/pom.xml | 1 + template-node/provider/pom.xml | 1 - 5 files changed, 7 insertions(+), 25 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index ee61d7d41..b624e069e 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -74,13 +74,11 @@ junit junit - 4.11 test org.mockito mockito-core - 1.10.19 test @@ -95,13 +93,11 @@ com.typesafe.akka akka-cluster_2.12 - ${akka.version} provided com.github.stefanbirkner system-rules - 1.19.0 test diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index a7a0842a4..0d23912fd 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -47,17 +47,14 @@ org.glassfish.jersey.bundles.repackaged jersey-guava - 2.22.2 org.glassfish.jersey.security oauth1-signature - ${jersey.version} org.glassfish.jersey.security oauth1-client - ${jersey.version} org.codehaus.jettison @@ -66,12 +63,10 @@ org.glassfish.jersey.core jersey-client - ${jersey.version} org.glassfish.jersey.media jersey-media-multipart - ${jersey.version} @@ -83,13 +78,11 @@ org.glassfish.jersey.containers jersey-container-servlet - ${jersey.version} test org.glassfish.jersey.containers jersey-container-grizzly2-http - ${jersey.version} test diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 70f84e09d..9fa247557 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -36,7 +36,6 @@ org.glassfish.jersey.media jersey-media-sse - ${jersey.version} javax.ws.rs @@ -46,15 +45,18 @@ org.onap.ccsdk.sli.core sli-common + + org.onap.ccsdk.sli.core + sli-provider + org.onap.ccsdk.sli.plugins properties-node-provider - 0.5.0-SNAPSHOT + ${project.version} org.opendaylight.yangtools yang-data-impl - 2.0.6.1 com.fasterxml.jackson.core @@ -63,17 +65,15 @@ dom4j dom4j - 1.6.1 com.google.code.gson gson - ${gson.version} org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.5.0-SNAPSHOT + ${project.version} org.opendaylight.netconf @@ -82,7 +82,6 @@ org.opendaylight.yangtools yang-parser-impl - 2.0.6.1 org.osgi @@ -99,37 +98,31 @@ org.mockito mockito-core - ${mockito.version} test org.glassfish.jersey.containers jersey-container-servlet - ${jersey.version} test org.glassfish.jersey.containers jersey-container-grizzly2-http - ${jersey.version} test org.hamcrest hamcrest-library - 1.3 test org.opendaylight.yangtools yang-test-util - 2.0.6.1 test org.glassfish.jersey.core jersey-client - ${jersey.version} test diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 81ab8811e..39f99d4bc 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -46,6 +46,7 @@ org.onap.ccsdk.sli.core sli-provider + org.onap.appc appc-ssh-adapter-api diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index b47c60409..08ff17caf 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -44,7 +44,6 @@ org.apache.velocity velocity - 1.7
-- cgit 1.2.3-korg From 50afefc403c7ae8d0c54f1602c580fbc7f5dd884 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Tue, 25 Jun 2019 14:53:01 +0000 Subject: Better support for timeouts in RestApiCallNode Support connect timeout and read timeout in a configurable way Issue-ID: CCSDK-1433 Signed-off-by: Smokowski, Kevin (ks6305) Change-Id: I58d77dfcb48adc2cf917aff29b0eb4a69acb9c17 --- .../sli/plugins/restapicall/RestapiCallNode.java | 32 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index adf723b8b..220e18fd0 100755 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -80,6 +80,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { protected static final String UEB_PROPERTIES_FILE_NAME = "ueb.properties"; protected static final String DEFAULT_PROPERTIES_DIR = "/opt/onap/ccsdk/data/properties"; protected static final String PROPERTIES_DIR_KEY = "SDNC_CONFIG_DIR"; + protected static final int DEFAULT_HTTP_CONNECT_TIMEOUT_MS = 30000; // 30 seconds + protected static final int DEFAULT_HTTP_READ_TIMEOUT_MS = 600000; // 10 minutes private static final Logger log = LoggerFactory.getLogger(RestapiCallNode.class); private String uebServers; @@ -93,7 +95,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { protected static final String restapiUrlString = "restapiUrl"; protected static final String restapiUserKey = "restapiUser"; protected static final String restapiPasswordKey = "restapiPassword"; - + protected Integer httpConnectTimeout; + protected Integer httpReadTimeout; + protected HashMap partnerStore; public RestapiCallNode() { @@ -116,6 +120,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } catch (Exception e) { log.warn("UEB properties could not be read, UEB support will not be enabled.", e); } + httpConnectTimeout = readOptionalInteger("HTTP_CONNECT_TIMEOUT_MS",DEFAULT_HTTP_CONNECT_TIMEOUT_MS); + httpReadTimeout = readOptionalInteger("HTTP_READ_TIMEOUT_MS",DEFAULT_HTTP_READ_TIMEOUT_MS); } protected void loadPartners(JSONObject partners) { @@ -754,7 +760,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } else { client = ClientBuilder.newBuilder().hostnameVerifier((s, sslSession) -> true).build(); } - client.property(ClientProperties.CONNECT_TIMEOUT, 5000); + setClientTimeouts(client); // Needed to support additional HTTP methods such as PATCH client.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); @@ -996,7 +1002,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { protected HttpResponse sendHttpData(byte[] data, FileParam p) throws SvcLogicException { Client client = ClientBuilder.newBuilder().build(); - client.property(ClientProperties.CONNECT_TIMEOUT, 5000); + setClientTimeouts(client); client.property(ClientProperties.FOLLOW_REDIRECTS, true); WebTarget webTarget = addAuthType(client, p).target(p.url); @@ -1127,7 +1133,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } Client client = ClientBuilder.newBuilder().build(); - client.property(ClientProperties.CONNECT_TIMEOUT, 5000); + setClientTimeouts(client); WebTarget webTarget = client.target(urls[0]); log.info("UEB URL: {}", urls[0]); @@ -1173,7 +1179,25 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { public void setDefaultUebTemplateFileName(String defaultUebTemplateFileName) { this.defaultUebTemplateFileName = defaultUebTemplateFileName; } + + protected void setClientTimeouts(Client client) { + client.property(ClientProperties.CONNECT_TIMEOUT, httpConnectTimeout); + client.property(ClientProperties.READ_TIMEOUT, httpReadTimeout); + } + + protected Integer readOptionalInteger(String propertyName, Integer defaultValue) { + String stringValue = System.getProperty(propertyName); + if (stringValue != null && stringValue.length() > 0) { + try { + return Integer.valueOf(stringValue); + } catch (NumberFormatException e) { + log.warn("property " + propertyName + " had the value " + stringValue + " that could not be converted to an Integer, default " + defaultValue + " will be used instead", e); + } + } + return defaultValue; + } + private static class FileParam { public String fileName; -- cgit 1.2.3-korg From bc136f3650f150b96e8940c5d6cf321376338510 Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Wed, 29 May 2019 21:25:31 +0000 Subject: feature file cleanup instead of each feature file starting ccsdk-sli let it be handled by bootfeatures Change-Id: Ie7f20c8861bf329471c6317ede8128a9c420a9f8 Issue-ID: CCSDK-1370 Signed-off-by: Smokowski, Kevin (ks6305) --- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 7 ---- .../ccsdk-gr-toolkit/src/main/feature/feature.xml | 7 ---- grToolkit/provider/pom.xml | 2 + .../features/ccsdk-properties-node/pom.xml | 8 +--- properties-node/provider/pom.xml | 10 +---- .../features/ccsdk-restapi-call-node/pom.xml | 8 +--- .../features/src/main/resources/features.xml | 42 -------------------- restapi-call-node/provider/pom.xml | 5 +-- .../features/ccsdk-restconf-client/pom.xml | 8 +--- restconf-client/provider/pom.xml | 13 ++++--- .../features/src/main/resources/features.xml | 45 ---------------------- sshapi-call-node/provider/pom.xml | 10 +---- template-node/features/ccsdk-template-node/pom.xml | 8 +--- template-node/provider/pom.xml | 1 + 14 files changed, 17 insertions(+), 157 deletions(-) mode change 100755 => 100644 grToolkit/features/ccsdk-gr-toolkit/pom.xml delete mode 100755 grToolkit/features/ccsdk-gr-toolkit/src/main/feature/feature.xml delete mode 100644 restapi-call-node/features/src/main/resources/features.xml delete mode 100644 sshapi-call-node/features/src/main/resources/features.xml (limited to 'restapi-call-node/provider') diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml old mode 100755 new mode 100644 index 37343c53c..fdbc61b78 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -23,13 +23,6 @@ xml features
- - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - ${project.groupId} gr-toolkit-model diff --git a/grToolkit/features/ccsdk-gr-toolkit/src/main/feature/feature.xml b/grToolkit/features/ccsdk-gr-toolkit/src/main/feature/feature.xml deleted file mode 100755 index 4a21ca550..000000000 --- a/grToolkit/features/ccsdk-gr-toolkit/src/main/feature/feature.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - mvn:org.onap.ccsdk.sli.core/ccsdk-sli/LATEST/xml/features - - ccsdk-sli - - diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index b624e069e..67c711775 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -48,11 +48,13 @@ org.onap.ccsdk.sli.core sli-common ${ccsdk.sli.core.version} + provided org.onap.ccsdk.sli.core sli-provider ${ccsdk.sli.core.version} + provided sal-test-model diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index ae007d6e4..c919c8434 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -19,13 +19,7 @@ - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - + ${project.groupId} properties-node-provider diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 2e3b5e76c..3ecd80d59 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -14,12 +14,7 @@ bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} - http://maven.apache.org - - UTF-8 - - @@ -46,10 +41,7 @@ org.onap.ccsdk.sli.core sli-common - - - org.onap.ccsdk.sli.core - sli-provider + provided org.slf4j diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 7062d6102..09657337c 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -22,13 +22,7 @@ javax.ws.rs javax.ws.rs-api - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - + ${project.groupId} restapi-call-node-provider diff --git a/restapi-call-node/features/src/main/resources/features.xml b/restapi-call-node/features/src/main/resources/features.xml deleted file mode 100644 index 3734a951a..000000000 --- a/restapi-call-node/features/src/main/resources/features.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features - - - sdnc-sli - spring - spring-dm - mvn:com.sun.jersey/jersey-client/${jersey.version} - mvn:com.sun.jersey.contribs.jersey-oauth/oauth-signature/${jersey.version} - mvn:com.sun.jersey.contribs.jersey-oauth/oauth-client/${jersey.version} - mvn:org.codehaus.jettison/jettison/${jettison.version} - mvn:org.onap.ccsdk.sli.plugins/restapi-call-node-provider/${project.version} - - - diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 0d23912fd..57af60727 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -15,10 +15,6 @@ ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - - UTF-8 - - @@ -39,6 +35,7 @@ org.onap.ccsdk.sli.core sli-common + provided org.slf4j diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 677a24671..985cc8daf 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -25,13 +25,7 @@ - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - + ${project.groupId} restconf-client-provider diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 9fa247557..2c4b8c3ea 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -14,11 +14,6 @@ bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} - http://maven.apache.org - - - UTF-8 - @@ -44,7 +39,13 @@ org.onap.ccsdk.sli.core sli-common - + provided + + + org.onap.ccsdk.sli.core + sli-provider + provided + org.onap.ccsdk.sli.core sli-provider diff --git a/sshapi-call-node/features/src/main/resources/features.xml b/sshapi-call-node/features/src/main/resources/features.xml deleted file mode 100644 index fd7caf535..000000000 --- a/sshapi-call-node/features/src/main/resources/features.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features - - - - sdnc-sli - spring - spring-dm - mvn:org.codehaus.jettison/jettison/${jettison.version} - mvn:org.onap.ccsdk.sli.core/sli-common/${project.version} - mvn:org.onap.ccsdk.sli.core/sli-provider/${project.version} - mvn:org.onap.appc/appc-ssh-adapter-api/1.3.0 - mvn:org.onap.ccsdk.sli.plugins/sshapi-call-node-provider/${project.version} - - - diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 39f99d4bc..b71e15765 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -14,11 +14,6 @@ bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} - http://maven.apache.org - - - UTF-8 - @@ -41,10 +36,7 @@ org.onap.ccsdk.sli.core sli-common - - - org.onap.ccsdk.sli.core - sli-provider + provided diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index f7a708729..115329bf5 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -17,13 +17,7 @@ ccsdk-sli-plugins :: template-node :: ${project.artifactId} - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - xml - features - + ${project.groupId} template-node-provider diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 08ff17caf..543a40d5e 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -36,6 +36,7 @@ org.onap.ccsdk.sli.core sli-common + provided org.slf4j -- cgit 1.2.3-korg From 1201ff98e4c7856b03b268302e4aed2cdc6e1dbb Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 17 Jul 2019 11:01:32 -0400 Subject: Update parent version to 1.3.1 Update parent poms to version 1.3.1-SNAPSHOT Change-Id: Ie3039a7d625a78b4ef1bf5170dcfe0553f9e9594 Issue-ID: CCSDK-1496 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- features/ccsdk-sli-plugins-all/pom.xml | 2 +- features/features-sli-plugins/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 2 +- grToolkit/features/features-gr-toolkit/pom.xml | 2 +- grToolkit/features/pom.xml | 2 +- grToolkit/installer/pom.xml | 2 +- grToolkit/model/pom.xml | 2 +- grToolkit/pom.xml | 2 +- grToolkit/provider/pom.xml | 2 +- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 2 +- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 2 +- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- restconf-client/features/ccsdk-restconf-client/pom.xml | 2 +- restconf-client/features/features-restconf-client/pom.xml | 2 +- restconf-client/features/pom.xml | 2 +- restconf-client/installer/pom.xml | 2 +- restconf-client/pom.xml | 2 +- restconf-client/provider/pom.xml | 2 +- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/pom.xml | 2 +- sshapi-call-node/installer/pom.xml | 2 +- sshapi-call-node/pom.xml | 2 +- sshapi-call-node/provider/pom.xml | 2 +- template-node/features/ccsdk-template-node/pom.xml | 2 +- template-node/features/features-template-node/pom.xml | 2 +- template-node/features/pom.xml | 2 +- template-node/installer/pom.xml | 2 +- template-node/pom.xml | 2 +- template-node/provider/pom.xml | 2 +- 43 files changed, 43 insertions(+), 43 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 261b955e4..3ffab5542 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index f36956a9c..b34bb0e9a 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index 931e46063..75038f559 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 58143e79f..ac3f7f9ab 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/features/pom.xml b/features/pom.xml index d8553b42f..20653b8c4 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index fdbc61b78..3e6c0934f 100644 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index 441e2e855..b40c67403 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index a27e71853..ea5d00d54 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 831edf707..13949b096 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index 439b05f0c..ab85fccfd 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index 2cdc71d08..2b47ba604 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index 67c711775..9e30d1e35 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index e66a40794..7c9feb460 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index c919c8434..69bdaddaa 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 0db5a9042..a4479ad33 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 79d56ff04..ac155ad59 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 42732871b..1f5806477 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index de936d9f2..4e66bc700 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 3ecd80d59..da88c07f0 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 09657337c..ab2f8b659 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index b5329ea8f..f230f0a1c 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 4820b7dd5..b9afd7ff4 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index d51cc610e..647e3a437 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index a84d3232d..37d53f563 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 57af60727..8c51f9974 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 985cc8daf..cde001de7 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 032a781e1..a902f9d72 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index ae4000266..bc658c9d9 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index bcf9e998d..47c5a4059 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index b9cad2629..2b1643062 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 2c4b8c3ea..c064394d1 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index a34b4aeee..a50f17893 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 04338facf..cf12bca82 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 35be47a4e..6c77b070a 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 029b94dea..64c352796 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 99c6d9edd..d820e871d 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index b71e15765..60abe7560 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index 115329bf5..c72f76951 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index 3c6f6d853..837b1c138 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index f919d1c09..10c74b8d3 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index 35161b8e5..93d56bb05 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/template-node/pom.xml b/template-node/pom.xml index b65c40e24..6244c8d10 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 543a40d5e..2a99c1029 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.0-SNAPSHOT + 1.3.1-SNAPSHOT org.onap.ccsdk.sli.plugins -- cgit 1.2.3-korg From 57bfbb05e485fb11b620b1bf12e70aa063aaa3c8 Mon Sep 17 00:00:00 2001 From: "Agarwal, Ruchira (ra1926)" Date: Mon, 22 Jul 2019 20:26:50 +0000 Subject: configurable param resolution support config parameter resolution to k8s secret value Issue-ID: CCSDK-1502 Signed-off-by: Agarwal, Ruchira (ra1926) Change-Id: I8acc98fa3fdd9ba46c617b4d0113086c1e889997 --- properties-node/provider/pom.xml | 24 +++++--- .../ccsdk/sli/plugins/prop/PropertiesNode.java | 27 +++++++-- .../ccsdk/sli/plugins/prop/TestPropertiesNode.java | 9 +++ .../provider/src/test/resources/test.txt | 3 +- restapi-call-node/provider/pom.xml | 24 +++++--- .../sli/plugins/restapicall/RestapiCallNode.java | 21 ++++++- .../plugins/restapicall/TestRestapiCallNode.java | 64 ++++++++++++++-------- .../provider/src/test/resources/partners.json | 6 ++ .../provider/src/test/resources/ueb.properties | 6 ++ 9 files changed, 138 insertions(+), 46 deletions(-) create mode 100644 restapi-call-node/provider/src/test/resources/ueb.properties (limited to 'restapi-call-node/provider') diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index da88c07f0..46c0dbac4 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -16,15 +16,15 @@ ccsdk-sli-plugins :: properties-node :: ${project.artifactId} - - - org.onap.ccsdk.sli.core - sli-core-artifacts - ${ccsdk.sli.core.version} - pom - import - - + + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + @@ -33,6 +33,12 @@ junit test + + com.github.stefanbirkner + system-rules + 1.19.0 + test + org.springframework spring-test diff --git a/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java b/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java index f0c7e0b45..b4bc84747 100644 --- a/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java +++ b/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java @@ -3,7 +3,7 @@ * openECOMP : SDN-C * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,14 +63,14 @@ public class PropertiesNode implements SvcLogicJavaPlugin { String name = (String) key; String value = prop.getProperty(name); if (value != null && value.trim().length() > 0) { - ctx.setAttribute(pfx + name, value.trim()); + ctx.setAttribute(pfx + name, getObfuscatedVal(value.trim())); log.info("+++ " + pfx + name + ": [" + maskPassword(pfx + name, value) + "]"); } } } if (mm != null) { for (Map.Entry entry : mm.entrySet()) { - ctx.setAttribute(pfx + entry.getKey(), entry.getValue()); + ctx.setAttribute(pfx + entry.getKey(), getObfuscatedVal(entry.getValue())); log.info("+++ " + pfx + entry.getKey() + ": [" + maskPassword(pfx + entry.getKey(), entry.getValue()) + "]"); } @@ -81,7 +81,7 @@ public class PropertiesNode implements SvcLogicJavaPlugin { String name = (String) key; String value = prop.getProperty(name); if (value != null && value.trim().length() > 0) { - ctx.setAttribute(pfx + name, value.trim()); + ctx.setAttribute(pfx + name, getObfuscatedVal(value.trim())); log.info("+++ " + pfx + name + ": [" + maskPassword(pfx + name, value) + "]"); } } @@ -92,6 +92,25 @@ public class PropertiesNode implements SvcLogicJavaPlugin { } } + /* Unobfuscate param value */ + private static String getObfuscatedVal(String paramValue) { + String resValue = paramValue; + if (paramValue != null && paramValue.startsWith("${") && paramValue.endsWith("}")) + { + String paramStr = paramValue.substring(2, paramValue.length()-1); + if (paramStr != null && paramStr.length() > 0) + { + String val = System.getenv(paramStr); + if (val != null && val.length() > 0) + { + resValue=val; + log.info("Obfuscated value RESET for param value:" + paramValue); + } + } + } + return resValue; + } + /* * Getting extension has to do the following "" --> "" "name" --> "" "name.txt" --> "txt" * ".htpasswd" --> "" "name.with.many.dots.myext" --> "myext" diff --git a/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java b/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java index f1e0ab627..a858c49b3 100644 --- a/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java +++ b/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java @@ -5,7 +5,9 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import org.junit.Rule; import org.junit.Test; +import org.junit.contrib.java.lang.system.EnvironmentVariables; import static org.junit.Assert.assertEquals; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; @@ -16,6 +18,8 @@ import org.slf4j.LoggerFactory; public class TestPropertiesNode { private static final Logger log = LoggerFactory.getLogger(TestPropertiesNode.class); + @Rule + public EnvironmentVariables environmentVariables = new EnvironmentVariables(); @Test public void testJSONFileParsing() throws SvcLogicException { @@ -129,6 +133,10 @@ public class TestPropertiesNode { @Test public void testTXTFileParsing() throws SvcLogicException { + + environmentVariables.set("deployer_pass", "sdncp-123"); + assertEquals("sdncp-123", System.getenv("deployer_pass")); + SvcLogicContext ctx = new SvcLogicContext(); Map p = new HashMap(); @@ -147,6 +155,7 @@ public class TestPropertiesNode { "access-information.l1-customer-handoff"),"_1000BASELX"); assertEquals(ctx.getAttribute("test-txt.service-data.avpn-ip-port-information.avpn-" + "access-information.vlan-tag-control"),"_1Q"); + assertEquals(ctx.getAttribute("test-txt.obfuscated-var"), "sdncp-123"); } @Test diff --git a/properties-node/provider/src/test/resources/test.txt b/properties-node/provider/src/test/resources/test.txt index 79e8acff4..68b916cbb 100644 --- a/properties-node/provider/src/test/resources/test.txt +++ b/properties-node/provider/src/test/resources/test.txt @@ -27,4 +27,5 @@ service-data.avpn-ip-port-information.contracted-port-speed-units = Kbps service-data.avpn-ip-port-information.endpoint-information.bundle-id = 33 service-data.avpn-ip-port-information.endpoint-information.interface-string = ae0 service-data.service-information.service-instance-id = ICORESITE-2751508 -service-data.service-information.service-type = AVPN \ No newline at end of file +service-data.service-information.service-type = AVPN +obfuscated-var=${deployer_pass} diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 8c51f9974..0373d1784 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -16,15 +16,15 @@ ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - - - org.onap.ccsdk.sli.core - sli-core-artifacts - ${ccsdk.sli.core.version} - pom - import - - + + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + @@ -72,6 +72,12 @@ junit test + + com.github.stefanbirkner + system-rules + 1.19.0 + test + org.glassfish.jersey.containers jersey-container-servlet diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 220e18fd0..c539010fb 100755 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -141,7 +141,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } String userName = partnerObject.getString(partnerUserKey); String password = partnerObject.getString(partnerPasswordKey); - PartnerDetails details = new PartnerDetails(userName, password, url); + PartnerDetails details = new PartnerDetails(userName, getObfuscatedVal(password), url); partnerStore.put(partnerKey, details); log.info("mapped partner using partner key " + partnerKey); } else { @@ -153,6 +153,25 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } } + /* Unobfuscate param value */ + private static String getObfuscatedVal(String paramValue) { + String resValue = paramValue; + if (paramValue != null && paramValue.startsWith("${") && paramValue.endsWith("}")) + { + String paramStr = paramValue.substring(2, paramValue.length()-1); + if (paramStr != null && paramStr.length() > 0) + { + String val = System.getenv(paramStr); + if (val != null && val.length() > 0) + { + resValue=val; + log.info("Obfuscated value RESET for param value:" + paramValue); + } + } + } + return resValue; + } + /** * Returns parameters from the parameter map. * diff --git a/restapi-call-node/provider/src/test/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java index 50371278a..a130d4390 100755 --- a/restapi-call-node/provider/src/test/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java +++ b/restapi-call-node/provider/src/test/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java @@ -3,7 +3,7 @@ * openECOMP : SDN-C * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. + * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,9 @@ import static org.junit.Assert.assertNull; import java.util.HashMap; import java.util.Map; +import org.junit.Rule; import org.junit.Test; +import org.junit.contrib.java.lang.system.EnvironmentVariables; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; @@ -38,6 +40,9 @@ public class TestRestapiCallNode { @SuppressWarnings("unused") private static final Logger log = LoggerFactory.getLogger(TestRestapiCallNode.class); + @Rule + public EnvironmentVariables environmentVariables = new EnvironmentVariables(); + @Test @@ -459,11 +464,15 @@ public class TestRestapiCallNode { */ @Test public void testPartners() throws Exception{ - String partnerTwoKey = "partnerTwo"; - String partnerTwoUsername = "controller_user"; - String partnerTwoPassword = "P@ssword"; - System.setProperty("SDNC_CONFIG_DIR", "src/test/resources"); + environmentVariables.set("deployer_pass", "sdncp-123"); + assertEquals("sdncp-123", System.getenv("deployer_pass")); + + String partnerTwoKey = "partnerTwo"; + String partnerTwoUsername = "controller_user"; + String partnerTwoPassword = "P@ssword"; + + System.setProperty("SDNC_CONFIG_DIR", "src/test/resources"); RestapiCallNode rcn = new RestapiCallNode(); assertNull(rcn.partnerStore.get("partnerOne")); PartnerDetails details = rcn.partnerStore.get(partnerTwoKey); @@ -474,7 +483,7 @@ public class TestRestapiCallNode { //In this scenario the caller expects username, password and url to be picked up from the partners json Map paramMap = new HashMap(); paramMap.put("partner", partnerTwoKey); - rcn.handlePartner(paramMap ); + rcn.handlePartner(paramMap ); assertEquals(partnerTwoUsername,paramMap.get(rcn.restapiUserKey)); assertEquals(partnerTwoPassword,paramMap.get(rcn.restapiPasswordKey)); assertEquals("http://localhost:7002",paramMap.get(rcn.restapiUrlString)); @@ -484,28 +493,39 @@ public class TestRestapiCallNode { paramMap = new HashMap(); paramMap.put("partner", partnerTwoKey); paramMap.put("restapiUrlSuffix", "/networking/v1/instance/3"); - rcn.handlePartner(paramMap); - Parameters p = new Parameters(); - RestapiCallNode.getParameters(paramMap, p); + rcn.handlePartner(paramMap); + p = new Parameters(); + RestapiCallNode.getParameters(paramMap, p); assertEquals(partnerTwoUsername,p.restapiUser); assertEquals(partnerTwoPassword,p.restapiPassword); assertEquals("http://localhost:7002/networking/v1/instance/3",p.restapiUrl); + + paramMap = new HashMap(); + paramMap.put("partner","partnerFour" ); + paramMap.put("httpMethod", "delete"); + paramMap.put("skipSending", "true"); + rcn.handlePartner(paramMap); + Parameters p = new Parameters(); + RestapiCallNode.getParameters(paramMap, p); + assertEquals(p.restapiPassword, "sdncp-123"); + assertEquals(p.restapiUser, "m30402@sdncp.att.com"); + assertEquals(p.restapiUrl, "http://localhost:7004"); } @Test public void retryPolicyBean() throws Exception { - Integer retries = 3; - String first = "http://localhost:7001"; - String second = "http://localhost:7001"; - - RetryPolicy p = new RetryPolicy(new String[] {first,second}, retries); - assertEquals(retries,p.getMaximumRetries()); - assertNotNull(p.getRetryMessage()); - String next = p.getNextHostName(); - assertEquals(second,next); - assertEquals(1,p.getRetryCount()); - next = p.getNextHostName(); - assertEquals(first,next); - assertEquals(2,p.getRetryCount()); + Integer retries = 3; + String first = "http://localhost:7001"; + String second = "http://localhost:7001"; + + RetryPolicy p = new RetryPolicy(new String[] {first,second}, retries); + assertEquals(retries,p.getMaximumRetries()); + assertNotNull(p.getRetryMessage()); + String next = p.getNextHostName(); + assertEquals(second,next); + assertEquals(1,p.getRetryCount()); + next = p.getNextHostName(); + assertEquals(first,next); + assertEquals(2,p.getRetryCount()); } } diff --git a/restapi-call-node/provider/src/test/resources/partners.json b/restapi-call-node/provider/src/test/resources/partners.json index 9a17a1acf..2562d69c0 100755 --- a/restapi-call-node/provider/src/test/resources/partners.json +++ b/restapi-call-node/provider/src/test/resources/partners.json @@ -12,5 +12,11 @@ "partnerThree": { "url": "http://localhost:7003", "user": "controller_admin" + }, + "partnerFour": { + "url": "http://localhost:7004", + "user": "m30402@sdncp.att.com", + "password": "${deployer_pass}", + "test": "/metrics" } } diff --git a/restapi-call-node/provider/src/test/resources/ueb.properties b/restapi-call-node/provider/src/test/resources/ueb.properties new file mode 100644 index 000000000..96657ee1a --- /dev/null +++ b/restapi-call-node/provider/src/test/resources/ueb.properties @@ -0,0 +1,6 @@ +#for other servers see http://sa2020.it.att.com:8888/sw/cambria/installs + +#to check connectivity http://hostname:3904/metrics + +servers=http://uebsb91kcdc.it.att.com:3904 http://uebsb92kcdc.it.att.com:3904 http://uebsb93kcdc.it.att.com:3904 + -- cgit 1.2.3-korg From ca4d38ae43092c4daab3eb172decc71c9ce1339a Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 6 Aug 2019 11:40:00 -0400 Subject: Roll version to recreate artifacts Roll version to 0.5.1 to recreate El Alto early drop artifacts Change-Id: Iccd4d14f5e0f55ab994a72cbf5b661c5790e2ae8 Issue-ID: CCSDK-1563 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 ++-- features/ccsdk-sli-plugins-all/pom.xml | 4 ++-- features/features-sli-plugins/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 4 ++-- grToolkit/features/features-gr-toolkit/pom.xml | 4 ++-- grToolkit/features/pom.xml | 4 ++-- grToolkit/installer/pom.xml | 4 ++-- grToolkit/model/pom.xml | 4 ++-- grToolkit/pom.xml | 4 ++-- grToolkit/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 4 ++-- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- restconf-client/features/ccsdk-restconf-client/pom.xml | 4 ++-- restconf-client/features/features-restconf-client/pom.xml | 4 ++-- restconf-client/features/pom.xml | 4 ++-- restconf-client/installer/pom.xml | 4 ++-- restconf-client/pom.xml | 4 ++-- restconf-client/provider/pom.xml | 4 ++-- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/pom.xml | 4 ++-- sshapi-call-node/installer/pom.xml | 4 ++-- sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/provider/pom.xml | 4 ++-- template-node/features/ccsdk-template-node/pom.xml | 4 ++-- template-node/features/features-template-node/pom.xml | 4 ++-- template-node/features/pom.xml | 4 ++-- template-node/installer/pom.xml | 4 ++-- template-node/pom.xml | 4 ++-- template-node/provider/pom.xml | 4 ++-- version.properties | 2 +- 44 files changed, 87 insertions(+), 87 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 3ffab5542..71e315341 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.plugins sli-plugins-artifacts - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: sli-plugins-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.3.1-SNAPSHOT + 1.3.2 diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index b34bb0e9a..2522ce584 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins ccsdk-sli-plugins-all - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index 75038f559..da9a571b0 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins features-sli-plugins - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index ac3f7f9ab..baa4fc381 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins sliplugins-features-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 20653b8c4..77bc51efe 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins sliplugins-feature-aggregator - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: features diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index 3e6c0934f..a25d95c67 100644 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins ccsdk-gr-toolkit - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index b40c67403..33a713524 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins features-gr-toolkit - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index ea5d00d54..a91fdeef7 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} gr-toolkit-features org.onap.ccsdk.sli.plugins - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 13949b096..59b5d4e91 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-gr-toolkit diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index ab85fccfd..a1d5ac47f 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-model - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index 2b47ba604..e2b77ca33 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins gr-toolkit - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: gr-toolkit diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index 9e30d1e35..6d6164354 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-provider - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle diff --git a/pom.xml b/pom.xml index 7c9feb460..d695012d2 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 69bdaddaa..11ed8b4d7 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index a4479ad33..118a272ed 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins features-properties-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index ac155ad59..adeb6fed3 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins properties-node-features - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 1f5806477..d0403454a 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins properties-node-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 4e66bc700..576bb5b69 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins properties-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 46c0dbac4..812f7cb70 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins properties-node-provider - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index ab2f8b659..31140f805 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index f230f0a1c..e14e04be0 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index b9afd7ff4..5a80ef1ab 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 647e3a437..6824f5024 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 37d53f563..530a449f6 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins restapi-call-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 0373d1784..c4a83539e 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index cde001de7..f9cc2e5f7 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins ccsdk-restconf-client - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index a902f9d72..64501ff40 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins features-restconf-client - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index bc658c9d9..713b42f2c 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins restconf-client-features - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 47c5a4059..33e874171 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins restconf-client-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 2b1643062..069494eab 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins restconf-client - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index c064394d1..7b1f2cbfe 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins restconf-client-provider - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index a50f17893..e34271786 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins ccsdk-sshapi-call-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index cf12bca82..9f43dbf42 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins features-sshapi-call-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 6c77b070a..b91af1fa2 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins sshapi-call-node-features - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 64c352796..12a744e29 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins sshapi-call-node-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index d820e871d..bb1a0dfc4 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins sshapi-call-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 60abe7560..45e3bb5ce 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins sshapi-call-node-provider - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index c72f76951..5ee4d0fe1 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins ccsdk-template-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index 837b1c138..0641a5a32 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins features-template-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT feature diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 10c74b8d3..9fa5fc199 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins template-node-features - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index 93d56bb05..d522ba52a 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins template-node-installer - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/pom.xml b/template-node/pom.xml index 6244c8d10..b75227f6a 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins template-node - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT pom diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 2a99c1029..21ef16e99 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.1-SNAPSHOT + 1.3.2 org.onap.ccsdk.sli.plugins template-node-provider - 0.5.0-SNAPSHOT + 0.5.1-SNAPSHOT bundle ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/version.properties b/version.properties index c8bc76801..2cb9acc8c 100644 --- a/version.properties +++ b/version.properties @@ -7,7 +7,7 @@ release_name=0 sprint_number=5 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 7ebd5f81dbe0f852c1383712270dae1bbd96527e Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 9 Aug 2019 13:55:10 -0400 Subject: Roll to next snapshot Roll to next snapshot version Change-Id: Ic49a7e77c9234ade7cf0e0c36cb830de2ef870ca Issue-ID: CCSDK-1563 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 ++-- features/ccsdk-sli-plugins-all/pom.xml | 4 ++-- features/features-sli-plugins/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 4 ++-- grToolkit/features/features-gr-toolkit/pom.xml | 4 ++-- grToolkit/features/pom.xml | 4 ++-- grToolkit/installer/pom.xml | 4 ++-- grToolkit/model/pom.xml | 4 ++-- grToolkit/pom.xml | 4 ++-- grToolkit/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 4 ++-- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- restconf-client/features/ccsdk-restconf-client/pom.xml | 4 ++-- restconf-client/features/features-restconf-client/pom.xml | 4 ++-- restconf-client/features/pom.xml | 4 ++-- restconf-client/installer/pom.xml | 4 ++-- restconf-client/pom.xml | 4 ++-- restconf-client/provider/pom.xml | 4 ++-- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/pom.xml | 4 ++-- sshapi-call-node/installer/pom.xml | 4 ++-- sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/provider/pom.xml | 4 ++-- template-node/features/ccsdk-template-node/pom.xml | 4 ++-- template-node/features/features-template-node/pom.xml | 4 ++-- template-node/features/pom.xml | 4 ++-- template-node/installer/pom.xml | 4 ++-- template-node/pom.xml | 4 ++-- template-node/provider/pom.xml | 4 ++-- version.properties | 2 +- 44 files changed, 87 insertions(+), 87 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 71e315341..9bc3a9c9b 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.plugins sli-plugins-artifacts - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: sli-plugins-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.3.2 + 1.3.3-SNAPSHOT diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index 2522ce584..6b7bf94d6 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins-all - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index da9a571b0..436306765 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins features-sli-plugins - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index baa4fc381..3d662e444 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-features-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 77bc51efe..29a67a820 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-feature-aggregator - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: features diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index a25d95c67..1f4aec3f8 100644 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-gr-toolkit - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index 33a713524..65b1a5d57 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins features-gr-toolkit - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index a91fdeef7..c7f8ffea7 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} gr-toolkit-features org.onap.ccsdk.sli.plugins - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 59b5d4e91..64e172cc2 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-gr-toolkit diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index a1d5ac47f..f400a04cc 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-model - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index e2b77ca33..c36c1a08d 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins gr-toolkit - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: gr-toolkit diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index 6d6164354..1d8149592 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-provider - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle diff --git a/pom.xml b/pom.xml index d695012d2..32ce564cd 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 11ed8b4d7..45adc9364 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 118a272ed..16588adbd 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index adeb6fed3..96121c6bc 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index d0403454a..cfc02dd3d 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 576bb5b69..aa5e75a52 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 812f7cb70..1f9fd46e2 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 31140f805..6578de4e9 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index e14e04be0..dd3af78a3 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 5a80ef1ab..48b91821e 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 6824f5024..f63597c57 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 530a449f6..10497fd36 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index c4a83539e..74f0a98be 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index f9cc2e5f7..af235f856 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restconf-client - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 64501ff40..17065acbe 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins features-restconf-client - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index 713b42f2c..455987fcb 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-features - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 33e874171..e7d8b4af4 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 069494eab..296282a56 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 7b1f2cbfe..1a734cdd2 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-provider - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index e34271786..3f6c97c1d 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sshapi-call-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 9f43dbf42..8a496684f 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins features-sshapi-call-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index b91af1fa2..4db5892e3 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-features - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 12a744e29..5d4ef718d 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index bb1a0dfc4..90bb6d511 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 45e3bb5ce..8af4faac5 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-provider - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index 5ee4d0fe1..a1b16a5ff 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-template-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index 0641a5a32..c220d4fb8 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins features-template-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT feature diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 9fa5fc199..143d9742f 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-features - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index d522ba52a..5de128457 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-installer - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/pom.xml b/template-node/pom.xml index b75227f6a..519388292 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins template-node - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT pom diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 21ef16e99..d3dd79412 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.2 + 1.3.3-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-provider - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT bundle ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/version.properties b/version.properties index 2cb9acc8c..dc2c5ad2a 100644 --- a/version.properties +++ b/version.properties @@ -7,7 +7,7 @@ release_name=0 sprint_number=5 -feature_revision=1 +feature_revision=2 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 9e7f1417df26d634482f053be2cf39b920a22106 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 9 Jul 2019 13:41:32 -0400 Subject: Code changes for Neon Updated code via ccsdk/parent/tools/fluorine2neon.sh script. Change-Id: Ice154214e118ca6ad5043eb0fe337095fd2246d9 Issue-ID: CCSDK-1389 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 +- features/ccsdk-sli-plugins-all/pom.xml | 4 +- features/features-sli-plugins/pom.xml | 4 +- features/installer/pom.xml | 4 +- features/pom.xml | 4 +- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 4 +- grToolkit/features/features-gr-toolkit/pom.xml | 4 +- grToolkit/features/pom.xml | 4 +- grToolkit/installer/pom.xml | 4 +- grToolkit/model/pom.xml | 14 +++--- grToolkit/pom.xml | 4 +- grToolkit/provider/pom.xml | 4 +- .../resources/OSGI-INF/blueprint/GrToolkit.xml | 33 ++++++++++++++ pom.xml | 4 +- .../features/ccsdk-properties-node/pom.xml | 4 +- .../features/features-properties-node/pom.xml | 4 +- properties-node/features/pom.xml | 4 +- properties-node/installer/pom.xml | 4 +- properties-node/pom.xml | 4 +- properties-node/provider/pom.xml | 4 +- .../blueprint/properties-node-blueprint.xml | 16 +++++++ .../features/ccsdk-restapi-call-node/pom.xml | 4 +- .../features/features-restapi-call-node/pom.xml | 4 +- restapi-call-node/features/pom.xml | 4 +- restapi-call-node/installer/pom.xml | 4 +- restapi-call-node/pom.xml | 4 +- restapi-call-node/provider/pom.xml | 4 +- .../blueprint/restapi-call-node-blueprint.xml | 16 +++++++ .../features/ccsdk-restconf-client/pom.xml | 4 +- .../features/features-restconf-client/pom.xml | 4 +- restconf-client/features/pom.xml | 4 +- restconf-client/installer/pom.xml | 4 +- restconf-client/pom.xml | 4 +- restconf-client/provider/pom.xml | 4 +- .../blueprint/restconf-client-blueprint.xml | 51 ++++++++++++++++++++++ .../features/ccsdk-sshapi-call-node/pom.xml | 4 +- .../features/features-sshapi-call-node/pom.xml | 4 +- sshapi-call-node/features/pom.xml | 4 +- sshapi-call-node/installer/pom.xml | 4 +- sshapi-call-node/pom.xml | 4 +- sshapi-call-node/provider/pom.xml | 4 +- .../blueprint/sshapi-call-node-blueprint.xml | 16 +++++++ template-node/features/ccsdk-template-node/pom.xml | 4 +- .../features/features-template-node/pom.xml | 4 +- template-node/features/pom.xml | 4 +- template-node/installer/pom.xml | 4 +- template-node/pom.xml | 4 +- template-node/provider/pom.xml | 4 +- version.properties | 4 +- 49 files changed, 224 insertions(+), 94 deletions(-) create mode 100755 grToolkit/provider/src/main/resources/OSGI-INF/blueprint/GrToolkit.xml create mode 100755 properties-node/provider/src/main/resources/OSGI-INF/blueprint/properties-node-blueprint.xml create mode 100755 restapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/restapi-call-node-blueprint.xml create mode 100755 restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml create mode 100755 sshapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/sshapi-call-node-blueprint.xml (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 9bc3a9c9b..7e395c9f9 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.plugins sli-plugins-artifacts - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: sli-plugins-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index 6b7bf94d6..bbcfb7570 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins-all - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index 436306765..1ace61b96 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-sli-plugins - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 3d662e444..334748748 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-features-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 29a67a820..6e349ca4a 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-feature-aggregator - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: features diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index 1f4aec3f8..3266f6604 100644 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-gr-toolkit - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index 65b1a5d57..511ba38a0 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-gr-toolkit - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index c7f8ffea7..34f706c8f 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} gr-toolkit-features org.onap.ccsdk.sli.plugins - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 64e172cc2..8c7ec32b2 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-gr-toolkit diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index f400a04cc..8abf89a08 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,23 +4,21 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-model - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle - org.opendaylight.mdsal.model - ietf-inet-types-2013-07-15 - - - org.opendaylight.mdsal.model - ietf-yang-types-20130715 + org.opendaylight.mdsal.binding.model.ietf + rfc6991 + + diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index c36c1a08d..916df4427 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins gr-toolkit - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: gr-toolkit diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index 1d8149592..0267f2488 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle diff --git a/grToolkit/provider/src/main/resources/OSGI-INF/blueprint/GrToolkit.xml b/grToolkit/provider/src/main/resources/OSGI-INF/blueprint/GrToolkit.xml new file mode 100755 index 000000000..5a4492c56 --- /dev/null +++ b/grToolkit/provider/src/main/resources/OSGI-INF/blueprint/GrToolkit.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 32ce564cd..6ee7dea9d 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 45adc9364..4781ac382 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 16588adbd..58944cceb 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 96121c6bc..bd93644d7 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index cfc02dd3d..536e20478 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index aa5e75a52..09991f46f 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 1f9fd46e2..8ca58c45c 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/provider/src/main/resources/OSGI-INF/blueprint/properties-node-blueprint.xml b/properties-node/provider/src/main/resources/OSGI-INF/blueprint/properties-node-blueprint.xml new file mode 100755 index 000000000..6e1d48efd --- /dev/null +++ b/properties-node/provider/src/main/resources/OSGI-INF/blueprint/properties-node-blueprint.xml @@ -0,0 +1,16 @@ + + + + + + + + + + org.onap.ccsdk.sli.plugins.prop.PropertiesNode + + + + \ No newline at end of file diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 6578de4e9..2697c4ea7 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index dd3af78a3..41a5d8a4b 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 48b91821e..981db516a 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index f63597c57..8b2d60ba6 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 10497fd36..d6fb0b49c 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 74f0a98be..7a03a38c3 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/restapi-call-node-blueprint.xml b/restapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/restapi-call-node-blueprint.xml new file mode 100755 index 000000000..390bb0a35 --- /dev/null +++ b/restapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/restapi-call-node-blueprint.xml @@ -0,0 +1,16 @@ + + + + + + + + + + org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode + + + + \ No newline at end of file diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index af235f856..8faa16a00 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restconf-client - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 17065acbe..790e5b128 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-restconf-client - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index 455987fcb..4537098fb 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index e7d8b4af4..09d290044 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 296282a56..e8b0123c3 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 1a734cdd2..ab685bb8b 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml b/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml new file mode 100755 index 000000000..45c335b13 --- /dev/null +++ b/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode + + + + + + org.onap.ccsdk.sli.plugins.restconfdiscovery.RestconfDiscoveryNode + + + + \ No newline at end of file diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index 3f6c97c1d..44c5540f3 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sshapi-call-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 8a496684f..893b68a76 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-sshapi-call-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 4db5892e3..6e31170a7 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 5d4ef718d..1b248a3d6 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 90bb6d511..66e2af306 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 8af4faac5..cd920a875 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/sshapi-call-node-blueprint.xml b/sshapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/sshapi-call-node-blueprint.xml new file mode 100755 index 000000000..7a5424329 --- /dev/null +++ b/sshapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/sshapi-call-node-blueprint.xml @@ -0,0 +1,16 @@ + + + + + + + + + + org.onap.ccsdk.sli.plugins.sshapicall.SshApiCallNode + + + + \ No newline at end of file diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index a1b16a5ff..91658ae62 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-template-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index c220d4fb8..105a03245 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-template-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 143d9742f..391a6ce14 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index 5de128457..2a5891dd4 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/pom.xml b/template-node/pom.xml index 519388292..0c811f714 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index d3dd79412..f9cd3ef2d 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/version.properties b/version.properties index dc2c5ad2a..3fc281cbc 100644 --- a/version.properties +++ b/version.properties @@ -6,8 +6,8 @@ # Comment release_name=0 -sprint_number=5 -feature_revision=2 +sprint_number=6 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From c08a8a7b8ce929195bff089f7743b5f31d609849 Mon Sep 17 00:00:00 2001 From: "Singal, Kapil (ks220y)" Date: Wed, 21 Aug 2019 13:53:30 -0400 Subject: RestapiCallNode URL Formatting Fix URL should be Encoded to related space or speical chars with respective encoded values. Example: space should be replaced with %20 Change-Id: Id58ffdb7d68c5440a33d229a2ac8683d5428a81e Issue-ID: CCSDK-1631 Signed-off-by: Singal, Kapil (ks220y) --- .../sli/plugins/restapicall/RestapiCallNode.java | 109 +++++++++++---------- 1 file changed, 56 insertions(+), 53 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index c539010fb..8038b94ce 100755 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -57,6 +57,7 @@ import javax.ws.rs.core.Feature; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; import org.apache.commons.lang3.StringUtils; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; @@ -97,7 +98,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { protected static final String restapiPasswordKey = "restapiPassword"; protected Integer httpConnectTimeout; protected Integer httpReadTimeout; - + protected HashMap partnerStore; public RestapiCallNode() { @@ -121,7 +122,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { log.warn("UEB properties could not be read, UEB support will not be enabled.", e); } httpConnectTimeout = readOptionalInteger("HTTP_CONNECT_TIMEOUT_MS",DEFAULT_HTTP_CONNECT_TIMEOUT_MS); - httpReadTimeout = readOptionalInteger("HTTP_READ_TIMEOUT_MS",DEFAULT_HTTP_READ_TIMEOUT_MS); + httpReadTimeout = readOptionalInteger("HTTP_READ_TIMEOUT_MS",DEFAULT_HTTP_READ_TIMEOUT_MS); } protected void loadPartners(JSONObject partners) { @@ -153,21 +154,21 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } } - /* Unobfuscate param value */ + /* Unobfuscate param value */ private static String getObfuscatedVal(String paramValue) { String resValue = paramValue; if (paramValue != null && paramValue.startsWith("${") && paramValue.endsWith("}")) { - String paramStr = paramValue.substring(2, paramValue.length()-1); - if (paramStr != null && paramStr.length() > 0) + String paramStr = paramValue.substring(2, paramValue.length()-1); + if (paramStr != null && paramStr.length() > 0) + { + String val = System.getenv(paramStr); + if (val != null && val.length() > 0) { - String val = System.getenv(paramStr); - if (val != null && val.length() > 0) - { - resValue=val; - log.info("Obfuscated value RESET for param value:" + paramValue); - } - } + resValue=val; + log.info("Obfuscated value RESET for param value:" + paramValue); + } + } } return resValue; } @@ -185,14 +186,16 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.templateFileName = parseParam(paramMap, "templateFileName", false, null); p.requestBody = parseParam(paramMap, "requestBody", false, null); p.restapiUrl = parseParam(paramMap, restapiUrlString, true, null); - validateUrl(p.restapiUrl); p.restapiUrlSuffix = parseParam(paramMap, "restapiUrlSuffix", false, null); - p.restapiUser = parseParam(paramMap, restapiUserKey, false, null); - p.restapiPassword = parseParam(paramMap, restapiPasswordKey, false, null); if (p.restapiUrlSuffix != null) { p.restapiUrl = p.restapiUrl + p.restapiUrlSuffix; - validateUrl(p.restapiUrl); } + + p.restapiUrl = UriBuilder.fromUri(p.restapiUrl).toTemplate(); + validateUrl(p.restapiUrl); + + p.restapiUser = parseParam(paramMap, restapiUserKey, false, null); + p.restapiPassword = parseParam(paramMap, restapiPasswordKey, false, null); p.oAuthConsumerKey = parseParam(paramMap, "oAuthConsumerKey", false, null); p.oAuthConsumerSecret = parseParam(paramMap, "oAuthConsumerSecret", false, null); p.oAuthSignatureMethod = parseParam(paramMap, "oAuthSignatureMethod", false, null); @@ -211,7 +214,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.keyStoreFileName = parseParam(paramMap, "keyStoreFileName", false, null); p.keyStorePassword = parseParam(paramMap, "keyStorePassword", false, null); p.ssl = p.trustStoreFileName != null && p.trustStorePassword != null && p.keyStoreFileName != null - && p.keyStorePassword != null; + && p.keyStorePassword != null; p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null); p.partner = parseParam(paramMap, "partner", false, null); p.dumpHeaders = valueOf(parseParam(paramMap, "dumpHeaders", false, null)); @@ -271,7 +274,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { * @throws SvcLogicException if required parameter value is empty */ public static String parseParam(Map paramMap, String name, boolean required, String def) - throws SvcLogicException { + throws SvcLogicException { String s = paramMap.get(name); if (s == null || s.trim().length() == 0) { @@ -457,7 +460,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } protected void sendRequest(Map paramMap, SvcLogicContext ctx, RetryPolicy retryPolicy) - throws SvcLogicException { + throws SvcLogicException { HttpResponse r = new HttpResponse(); try { @@ -526,7 +529,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (retryPolicy.shouldRetry()) { paramMap.put(restapiUrlString, retryString); log.debug("retry attempt {} will use the retry url {}", retryPolicy.getRetryCount(), - retryString); + retryString); sendRequest(paramMap, ctx, retryPolicy); } else { log.debug("Maximum retries reached, won't attempt to retry. Calling setFailureResponseStatus."); @@ -534,7 +537,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } } catch (Exception ex) { String retryErrorMessage = "Retry attempt " + retryPolicy.getRetryCount() - + "has failed with error message " + ex.getMessage(); + + "has failed with error message " + ex.getMessage(); setFailureResponseStatus(ctx, prefix, retryErrorMessage, r); } } @@ -607,7 +610,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } String req = format == Format.XML ? XmlJsonUtil.removeEmptyStructXml(ss.toString()) - : XmlJsonUtil.removeEmptyStructJson(originalTemplate, ss.toString()); + : XmlJsonUtil.removeEmptyStructJson(originalTemplate, ss.toString()); if (format == Format.JSON) { req = XmlJsonUtil.removeLastCommaJson(req); @@ -632,7 +635,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { int i2 = template.indexOf(':', i1 + 9); if (i2 < 0) { throw new SvcLogicException( - "Template error: Context variable name followed by : is required after repeat"); + "Template error: Context variable name followed by : is required after repeat"); } // Find the closing }, store in i3 @@ -716,8 +719,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { client.register(HttpAuthenticationFeature.basic(p.restapiUser, p.restapiPassword)); } else if (p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null && p.oAuthSignatureMethod != null) { Feature oAuth1Feature = - OAuth1ClientSupport.builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) - .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); + OAuth1ClientSupport.builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) + .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); client.register(oAuth1Feature); } @@ -727,30 +730,30 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { client.register(HttpAuthenticationFeature.digest(p.restapiUser, p.restapiPassword)); } else { throw new SvcLogicException( - "oAUTH authentication type selected but all restapiUser and restapiPassword " - + "parameters doesn't exist", - new Throwable()); + "oAUTH authentication type selected but all restapiUser and restapiPassword " + + "parameters doesn't exist", + new Throwable()); } } else if (p.authtype == AuthType.BASIC) { if (p.restapiUser != null && p.restapiPassword != null) { client.register(HttpAuthenticationFeature.basic(p.restapiUser, p.restapiPassword)); } else { throw new SvcLogicException( - "oAUTH authentication type selected but all restapiUser and restapiPassword " - + "parameters doesn't exist", - new Throwable()); + "oAUTH authentication type selected but all restapiUser and restapiPassword " + + "parameters doesn't exist", + new Throwable()); } } else if (p.authtype == AuthType.OAUTH) { if (p.oAuthConsumerKey != null && p.oAuthConsumerSecret != null && p.oAuthSignatureMethod != null) { Feature oAuth1Feature = OAuth1ClientSupport - .builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) - .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); + .builder(new ConsumerCredentials(p.oAuthConsumerKey, p.oAuthConsumerSecret)) + .version(p.oAuthVersion).signatureMethod(p.oAuthSignatureMethod).feature().build(); client.register(oAuth1Feature); } else { throw new SvcLogicException( - "oAUTH authentication type selected but all oAuthConsumerKey, oAuthConsumerSecret " - + "and oAuthSignatureMethod parameters doesn't exist", - new Throwable()); + "oAUTH authentication type selected but all oAuthConsumerKey, oAuthConsumerSecret " + + "and oAuthSignatureMethod parameters doesn't exist", + new Throwable()); } } } @@ -814,7 +817,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { for (String singlePair : keyValuePairs) { int equalPosition = singlePair.indexOf('='); invocationBuilder.header(singlePair.substring(0, equalPosition), - singlePair.substring(equalPosition + 1, singlePair.length())); + singlePair.substring(equalPosition + 1, singlePair.length())); } } @@ -847,7 +850,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { multiPart.setMediaType(MediaType.MULTIPART_FORM_DATA_TYPE); FileDataBodyPart fileDataBodyPart = - new FileDataBodyPart("file", new File(p.multipartFile), MediaType.APPLICATION_OCTET_STREAM_TYPE); + new FileDataBodyPart("file", new File(p.multipartFile), MediaType.APPLICATION_OCTET_STREAM_TYPE); multiPart.bodyPart(fileDataBodyPart); @@ -862,7 +865,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { for (String singlePair : keyValuePairs) { int equalPosition = singlePair.indexOf('='); invocationBuilder.header(singlePair.substring(0, equalPosition), - singlePair.substring(equalPosition + 1, singlePair.length())); + singlePair.substring(equalPosition + 1, singlePair.length())); } } @@ -872,7 +875,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { try { response = - invocationBuilder.method(p.httpMethod.toString(), entity(multiPart, multiPart.getMediaType())); + invocationBuilder.method(p.httpMethod.toString(), entity(multiPart, multiPart.getMediaType())); } catch (ProcessingException | IllegalStateException e) { throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } @@ -923,7 +926,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } protected void setFailureResponseStatus(SvcLogicContext ctx, String prefix, String errorMessage, - HttpResponse resp) { + HttpResponse resp) { resp.code = 500; resp.message = errorMessage; String pp = prefix != null ? prefix + '.' : ""; @@ -1198,25 +1201,25 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { public void setDefaultUebTemplateFileName(String defaultUebTemplateFileName) { this.defaultUebTemplateFileName = defaultUebTemplateFileName; } - + protected void setClientTimeouts(Client client) { client.property(ClientProperties.CONNECT_TIMEOUT, httpConnectTimeout); - client.property(ClientProperties.READ_TIMEOUT, httpReadTimeout); + client.property(ClientProperties.READ_TIMEOUT, httpReadTimeout); } protected Integer readOptionalInteger(String propertyName, Integer defaultValue) { - String stringValue = System.getProperty(propertyName); - if (stringValue != null && stringValue.length() > 0) { - try { - return Integer.valueOf(stringValue); - } catch (NumberFormatException e) { - log.warn("property " + propertyName + " had the value " + stringValue + " that could not be converted to an Integer, default " + defaultValue + " will be used instead", e); - } - } - return defaultValue; + String stringValue = System.getProperty(propertyName); + if (stringValue != null && stringValue.length() > 0) { + try { + return Integer.valueOf(stringValue); + } catch (NumberFormatException e) { + log.warn("property " + propertyName + " had the value " + stringValue + " that could not be converted to an Integer, default " + defaultValue + " will be used instead", e); + } + } + return defaultValue; } - + private static class FileParam { public String fileName; -- cgit 1.2.3-korg From 43c9e83b3cc9b3dfaf55f08fc25813a77a4f2784 Mon Sep 17 00:00:00 2001 From: "Agarwal, Ruchira (ra1926)" Date: Wed, 28 Aug 2019 01:48:21 +0000 Subject: sync restapi-call-node with ecomp sync onap rest-api-call-node with ecomp Issue-ID: CCSDK-1659 Signed-off-by: Agarwal, Ruchira (ra1926) Change-Id: I08b0b8332b68a22710cd412997f3763de4b5b8d3 --- .../sli/plugins/restapicall/HttpResponse.java | 7 +- .../ccsdk/sli/plugins/restapicall/JsonParser.java | 12 ++- .../ccsdk/sli/plugins/restapicall/RetryPolicy.java | 43 ++++---- .../ccsdk/sli/plugins/restapicall/XmlJsonUtil.java | 119 +++++++++++++-------- .../ccsdk/sli/plugins/restapicall/XmlParser.java | 11 +- .../sli/plugins/restapicall/TestXmlJsonUtil.java | 59 ++++++++++ .../provider/src/test/resources/test-template.json | 1 + 7 files changed, 181 insertions(+), 71 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java index 66993aabc..574089528 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpResponse.java @@ -8,9 +8,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,6 +21,8 @@ package org.onap.ccsdk.sli.plugins.restapicall; +import java.util.List; +import java.util.Map; import javax.ws.rs.core.MultivaluedMap; public class HttpResponse { @@ -28,4 +30,5 @@ public class HttpResponse { public String message; public String body; public MultivaluedMap headers; + public Map> headers2; } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java index 189ddde31..910baf52b 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/JsonParser.java @@ -8,7 +8,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software @@ -50,7 +50,15 @@ public final class JsonParser { checkNotNull(s, "Input should not be null."); try { - JSONObject json = new JSONObject(s); + JSONObject json = null; + //support top level list in json response + if (s.startsWith("[")) { + JSONArray jsonArr = new JSONArray(s); + json = jsonArr.getJSONObject(0); + } else { + json = new JSONObject(s); + } + Map wm = new HashMap<>(); Iterator ii = json.keys(); while (ii.hasNext()) { diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java index 65684d937..8d5143be3 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java @@ -21,41 +21,44 @@ */ package org.onap.ccsdk.sli.plugins.restapicall; + public class RetryPolicy { private String[] hostnames; private Integer maximumRetries; - private int position; - private int retryCount; + public RetryPolicy(String[] hostnames, Integer maximumRetries) { - this.hostnames = hostnames; - this.maximumRetries = maximumRetries; - - this.position = 0; - - this.retryCount = 0; + this.hostnames = hostnames; + this.maximumRetries = maximumRetries; + this.position = 0; + this.retryCount = 0; + } + public Integer getMaximumRetries() { - return maximumRetries; + return maximumRetries; } + public int getRetryCount() { - return retryCount; + return retryCount; } + public Boolean shouldRetry() { - return retryCount < maximumRetries + 1; + return retryCount < maximumRetries + 1; } + public String getRetryMessage() { - return retryCount + " retry attempts were made out of " + maximumRetries + " maximum retry attempts."; + return retryCount + " retry attempts were made out of " + maximumRetries + " maximum retry attempts."; } public String getNextHostName() throws RetryException { - retryCount++; - position++; - - if (position > hostnames.length - 1) { - position = 0; - } - return hostnames[position]; + retryCount++; + position++; + if (position > hostnames.length - 1) { + position = 0; } -} \ No newline at end of file + return hostnames[position]; + } + +} diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java index 4712b4298..bc6afd84c 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -8,9 +8,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,38 +66,45 @@ public final class XmlJsonUtil { private static Object createStructure(Map flatmap, String var) { if (flatmap.containsKey(var)) { - if (var.endsWith("_length") || var.endsWith("].key")) + if (var.endsWith("_length") || var.endsWith("].key")) { return null; + } return flatmap.get(var); } Map mm = new HashMap<>(); - for (String k : flatmap.keySet()) + for (String k : flatmap.keySet()) { if (k.startsWith(var + ".")) { int i1 = k.indexOf('.', var.length() + 1); int i2 = k.indexOf('[', var.length() + 1); int i3 = k.length(); - if (i1 > 0 && i1 < i3) + if (i1 > 0 && i1 < i3) { i3 = i1; - if (i2 > 0 && i2 < i3) + } + if (i2 > 0 && i2 < i3) { i3 = i2; + } String k1 = k.substring(var.length() + 1, i3); String var1 = k.substring(0, i3); if (!mm.containsKey(k1)) { Object str = createStructure(flatmap, var1); - if (str != null && (!(str instanceof String) || ((String) str).trim().length() > 0)) + if (str != null && (!(str instanceof String) || ((String) str).trim().length() > 0)) { mm.put(k1, str); + } } } - if (!mm.isEmpty()) + } + if (!mm.isEmpty()) { return mm; + } boolean arrayFound = false; - for (String k : flatmap.keySet()) + for (String k : flatmap.keySet()) { if (k.startsWith(var + "[")) { arrayFound = true; break; } + } if (arrayFound) { List ll = new ArrayList<>(); @@ -115,13 +121,15 @@ public final class XmlJsonUtil { for (int i = 0; i < length; i++) { Object v = createStructure(flatmap, var + '[' + i + ']'); - if (v == null) + if (v == null) { break; + } ll.add(v); } - if (!ll.isEmpty()) + if (!ll.isEmpty()) { return ll; + } } return null; @@ -129,16 +137,18 @@ public final class XmlJsonUtil { @SuppressWarnings("unchecked") private static String generateXml(Object o, int indent, boolean escape) { - if (o == null) + if (o == null) { return null; + } - if (o instanceof String) - return escape ? escapeXml((String) o) : (String) o;; + if (o instanceof String) { + return escape ? escapeXml((String) o) : (String) o; + }; if (o instanceof Map) { StringBuilder ss = new StringBuilder(); Map mm = (Map) o; - for (Map.Entry entry: mm.entrySet()) { + for (Map.Entry entry : mm.entrySet()) { Object v = entry.getValue(); String key = entry.getKey(); if (v instanceof String) { @@ -164,10 +174,13 @@ public final class XmlJsonUtil { return null; } - private static String generateJson(Object o, boolean escape, boolean quotes) { - if (o == null) + if (o == null) { return null; + } + if (o instanceof String && ((String) o).length() == 0) { + return null; + } StringBuilder ss = new StringBuilder(); generateJson(ss, o, 0, false, escape, quotes); @@ -178,8 +191,9 @@ public final class XmlJsonUtil { private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape, boolean quotes) { if (o instanceof String) { String s = escape ? escapeJson((String) o) : (String) o; - if (padFirst) + if (padFirst) { ss.append(pad(indent)); + } if (quotes) { ss.append('"').append(s).append('"'); } else { @@ -191,14 +205,16 @@ public final class XmlJsonUtil { if (o instanceof Map) { Map mm = (Map) o; - if (padFirst) + if (padFirst) { ss.append(pad(indent)); + } ss.append("{\n"); boolean first = true; for (Map.Entry entry : mm.entrySet()) { - if (!first) + if (!first) { ss.append(",\n"); + } first = false; Object v = entry.getValue(); String key = entry.getKey(); @@ -215,14 +231,16 @@ public final class XmlJsonUtil { if (o instanceof List) { List ll = (List) o; - if (padFirst) + if (padFirst) { ss.append(pad(indent)); + } ss.append("[\n"); boolean first = true; for (Object o1 : ll) { - if (!first) + if (!first) { ss.append(",\n"); + } first = false; generateJson(ss, o1, indent + 1, true, escape, quotes); @@ -241,14 +259,16 @@ public final class XmlJsonUtil { int i11 = s.indexOf('}', k); int i12 = s.indexOf(']', k); int i1 = -1; - if (i11 < 0) + if (i11 < 0) { i1 = i12; - else if (i12 < 0) + } else if (i12 < 0) { i1 = i11; - else + } else { i1 = i11 < i12 ? i11 : i12; - if (i1 < 0) + } + if (i1 < 0) { break; + } int i2 = s.lastIndexOf(',', i1); if (i2 < 0) { @@ -282,15 +302,14 @@ public final class XmlJsonUtil { if (i11 < 0) { i1 = i12; curly = false; - } else if (i12 < 0) + } else if (i12 < 0) { i1 = i11; - else - if (i11 < i12) - i1 = i11; - else { - i1 = i12; - curly = false; - } + } else if (i11 < i12) { + i1 = i11; + } else { + i1 = i12; + curly = false; + } if (i1 >= 0) { int i2 = curly ? s.indexOf('}', i1) : s.indexOf(']', i1); @@ -298,25 +317,31 @@ public final class XmlJsonUtil { String value = s.substring(i1 + 1, i2); if (value.trim().length() == 0) { int i4 = s.lastIndexOf('\n', i1); - if (i4 < 0) + if (i4 < 0) { i4 = 0; + } int i5 = s.indexOf('\n', i2); - if (i5 < 0) + if (i5 < 0) { i5 = s.length(); + } + /*If template mandates empty construct to be present, those should not be removed.*/ - if ((template != null) && template.contains(s.substring(i4))) { + if (template != null && template.contains(s.substring(i4))) { k = i1 + 1; } else { s = s.substring(0, i4) + s.substring(i5); k = 0; } - } else + } else { k = i1 + 1; - } else + } + } else { break; - } else + } + } else { break; + } } return s; @@ -326,8 +351,9 @@ public final class XmlJsonUtil { int k = 0; while (k < s.length()) { int i1 = s.indexOf('<', k); - if (i1 < 0 || i1 == s.length() - 1) + if (i1 < 0 || i1 == s.length() - 1) { break; + } char c1 = s.charAt(i1 + 1); if (c1 == '?' || c1 == '!') { @@ -355,11 +381,13 @@ public final class XmlJsonUtil { } int i4 = s.lastIndexOf('\n', i1); - if (i4 < 0) + if (i4 < 0) { i4 = 0; + } int i5 = s.indexOf('\n', i3); - if (i5 < 0) + if (i5 < 0) { i5 = s.length(); + } s = s.substring(0, i4) + s.substring(i5); k = 0; @@ -385,8 +413,9 @@ public final class XmlJsonUtil { private static String pad(int n) { StringBuilder s = new StringBuilder(); - for (int i = 0; i < n; i++) + for (int i = 0; i < n; i++) { s.append(Character.toString('\t')); + } return s.toString(); } } diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java index cf6af66f2..42e9e57ad 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlParser.java @@ -35,6 +35,7 @@ import java.util.Set; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; +import javax.xml.XMLConstants; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.slf4j.Logger; @@ -42,6 +43,7 @@ import org.slf4j.LoggerFactory; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; +import org.xml.sax.XMLReader; public final class XmlParser { @@ -58,10 +60,15 @@ public final class XmlParser { Handler handler = new Handler(listNameList); try { - SAXParserFactory factory = SAXParserFactory.newInstance(); - SAXParser saxParser = factory.newSAXParser(); + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + spf.setFeature("http://xml.org/sax/features/external-general-entities", false); + spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); InputStream in = new ByteArrayInputStream(s.getBytes()); + SAXParser saxParser = spf.newSAXParser(); saxParser.parse(in, handler); + } catch (ParserConfigurationException | IOException | SAXException | NumberFormatException e) { throw new SvcLogicException("Unable to convert XML to properties" + e.getLocalizedMessage(), e); } diff --git a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java index 9812f2a11..ac6d3b78b 100644 --- a/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java +++ b/restapi-call-node/provider/src/test/java/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java @@ -152,6 +152,65 @@ public class TestXmlJsonUtil { log.info(ss); } + public void testRemoveEmptyStructJson1() { + String xmlin = "{\n" + + " \"policyName\" : \"default-domain.ECOM_Tenant_DND.ECOM_Tenant_DND_mtn6_HngwOamNetVto." + + "HNGWOAMNETVTO.OAM_landing-network-role_policy_05\",\n" + + " \"policyConfigType\": \"MicroService\",\n" + + " \"ecompName\": \"SDNC\",\n" + + " \"configBody\": \"{\\\"service\\\": \\\"NetworkPolicy\\\"," + + "\\\"location\\\": \\\"Search\\\",\\\"uuid\\\": \\\"Search\\\"," + + "\\\"policyName\\\": \\\"default-domain.ECOM_Tenant_DND.ECOM_Tenant_DND_mtn6_HngwOamNetVto." + + "HNGWOAMNETVTO.OAM_landing-network-role_policy_05\\\"," + + "\\\"description\\\": \\\"default-domain.ECOM_Tenant_DND.ECOM_Tenant_DND_mtn6_HngwOamNetVto." + + "HNGWOAMNETVTO.OAM_landing-network-role_policy_05\\\",\\\"configName\\\": \\\"Search\\\"," + + "\\\"templateVersion\\\": \\\"1607\\\",\\\"version\\\": \\\"1.3.0.1\\\"," + + "\\\"priority\\\": \\\"2\\\",\\\"policyScope\\\": \\\"SDNC\\\",\\\"riskType\\\": \\\"low\\\"," + + "\\\"riskLevel\\\": \\\"2\\\",\\\"guard\\\": \\\"True\\\",\\\"content\\\":{ " + + "\\\"network-policy\\\": { \\\"display_name\\\": \\\"default-domain.ECOM_Tenant_DND." + + "ECOM_Tenant_DND_mtn6_HngwOamNetVto.HNGWOAMNETVTO.OAM_landing-network-role_policy_05\\\", " + + "\\\"fq_name\\\": [ \\\"default-domain\\\", " + + "\\\"ECOM_Tenant_DND\\\", \\\"default-domain." + + "ECOM_Tenant_DND.ECOM_Tenant_DND_mtn6_HngwOamNetVto." + + "HNGWOAMNETVTO.OAM_landing-network-role_policy_05\\\" ], " + + "\\\"id_perms\\\": { \\\"user_visible\\\": true }, " + + "\\\"parent_type\\\": \\\"project\\\", \\\"network_policy_entries\\\": { " + + "\\\"policy_rule\\\": [ { " + + "\\\"action_list\\\": { \\\"apply_service\\\": [ " + + "\\\"testfqdn\\\" ], " + + "\\\"gateway_name\\\": null, \\\"qos_action\\\": null, " + + "\\\"log\\\": false , \\\"mirror_to\\\": null, " + + "\\\"simple_action\\\": null }, " + + "\\\"ethertype\\\": null, \\\"application\\\": [], " + + "\\\"direction\\\": \\\"<>\\\", \\\"dst_addresses\\\": [ " + + "{ \\\"network_policy\\\": null, " + + "\\\"security_group\\\": null, " + + "\\\"subnet\\\": null, \\\"virtual_network\\\": " + + "\\\"default-domain:ECOM_Tenant_DND:ECOM_Tenant_DND_int_HngwOamNetVto." + + "HNGWOAMNETVTO.OAM_net_10\\\" } ], " + + "\\\"dst_ports\\\": [ { " + + "\\\"end_port\\\": -1, \\\"start_port\\\": -1 " + + "} ], \\\"protocol\\\": \\\"any\\\", " + + "\\\"src_addresses\\\": [ { " + + "\\\"network_policy\\\": null, " + + "\\\"security_group\\\": null, " + + "\\\"subnet\\\": null, \\\"virtual_network\\\": " + + "\\\"default-domain:ECOM_Tenant_DND:ECOM_Tenant_DND_int_HngwOamNetVto." + + "HNGWOAMNETVTO.OAM_net_9\\\" } ], " + + "\\\"src_ports\\\": [ { " + + "\\\"end_port\\\": -1, " + + "\\\"start_port\\\": -1 } ] } " + + "] } }}}\"\n" + + "}"; + + String xmloutexpected = xmlin; + + String xmlout = XmlJsonUtil.removeEmptyStructJson(null, xmlin); + log.info(xmlout); + + Assert.assertEquals(xmloutexpected, xmlout); + } + @Test public void testRemoveEmptyStructXml() { String xmlin = "" + diff --git a/restapi-call-node/provider/src/test/resources/test-template.json b/restapi-call-node/provider/src/test/resources/test-template.json index 4adc6637a..faefef31e 100644 --- a/restapi-call-node/provider/src/test/resources/test-template.json +++ b/restapi-call-node/provider/src/test/resources/test-template.json @@ -51,6 +51,7 @@ "run-id": ${tmp.sdn-circuit-req-row[${1}].run-id}, "hostname": ${tmp.sdn-circuit-req-row[${1}].hostname}, "algo-request-reason": ${tmp.sdn-circuit-req-row[${1}].algo-request-reason} + "test-empty-value": ${tmp.sdn-circuit-req-row[${1}].test-empty-value} }, } ] -- cgit 1.2.3-korg From b6455c548b7003019c8f8b6e1ecc3966f3aca278 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 28 Aug 2019 13:16:09 -0400 Subject: Roll versions Roll versions in master branch Change-Id: I38f82f09f8cdf7324145895a053f5513117502ea Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 ++-- ccsdk-plugins-lighty/pom.xml | 4 ++-- features/ccsdk-sli-plugins-all/pom.xml | 4 ++-- features/features-sli-plugins/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 4 ++-- grToolkit/features/features-gr-toolkit/pom.xml | 4 ++-- grToolkit/features/pom.xml | 4 ++-- grToolkit/installer/pom.xml | 4 ++-- grToolkit/model/pom.xml | 4 ++-- grToolkit/pom.xml | 4 ++-- grToolkit/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 4 ++-- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/lighty/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/lighty/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- restconf-client/features/ccsdk-restconf-client/pom.xml | 4 ++-- restconf-client/features/features-restconf-client/pom.xml | 4 ++-- restconf-client/features/pom.xml | 4 ++-- restconf-client/installer/pom.xml | 4 ++-- restconf-client/lighty/pom.xml | 4 ++-- restconf-client/pom.xml | 4 ++-- restconf-client/provider/pom.xml | 4 ++-- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/pom.xml | 4 ++-- sshapi-call-node/installer/pom.xml | 4 ++-- sshapi-call-node/lighty/pom.xml | 4 ++-- sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/provider/pom.xml | 4 ++-- template-node/features/ccsdk-template-node/pom.xml | 4 ++-- template-node/features/features-template-node/pom.xml | 4 ++-- template-node/features/pom.xml | 4 ++-- template-node/installer/pom.xml | 4 ++-- template-node/lighty/pom.xml | 4 ++-- template-node/pom.xml | 4 ++-- template-node/provider/pom.xml | 4 ++-- version.properties | 2 +- 50 files changed, 99 insertions(+), 99 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 7e395c9f9..59e334acf 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.plugins sli-plugins-artifacts - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: sli-plugins-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT diff --git a/ccsdk-plugins-lighty/pom.xml b/ccsdk-plugins-lighty/pom.xml index 5630f3bc0..8ac8ffcc1 100755 --- a/ccsdk-plugins-lighty/pom.xml +++ b/ccsdk-plugins-lighty/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-plugins-lighty - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index bbcfb7570..1054f1903 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins-all - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index 1ace61b96..dff558c6a 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-sli-plugins - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 334748748..529588c58 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-features-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 6e349ca4a..3780233ec 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-feature-aggregator - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: features diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index 3266f6604..88d931d33 100644 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-gr-toolkit - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index 511ba38a0..f22ed5d29 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-gr-toolkit - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index 34f706c8f..37179a551 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} gr-toolkit-features org.onap.ccsdk.sli.plugins - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 8c7ec32b2..4d097054f 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-gr-toolkit diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index 8abf89a08..646564a90 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-model - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index 916df4427..b55df5cd7 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins gr-toolkit - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: gr-toolkit diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index 0267f2488..f8228c2b5 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-provider - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle diff --git a/pom.xml b/pom.xml index 9fa01554d..a8f8584f3 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index 4781ac382..b80d8f429 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 58944cceb..485d29534 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index bd93644d7..83bc1da13 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 536e20478..3af5efc7a 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/lighty/pom.xml b/properties-node/lighty/pom.xml index 4e0fdb303..6a5023d51 100755 --- a/properties-node/lighty/pom.xml +++ b/properties-node/lighty/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-lighty - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 64036f7b1..53fa2b2d9 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 8ca58c45c..262c4968d 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 2697c4ea7..6f3109e4d 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 41a5d8a4b..4350f75b4 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 981db516a..a49633d5a 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 8b2d60ba6..697cfdcc8 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/lighty/pom.xml b/restapi-call-node/lighty/pom.xml index 5faa654b1..f6af499cb 100755 --- a/restapi-call-node/lighty/pom.xml +++ b/restapi-call-node/lighty/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-lighty - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 7fbce0243..ece6a5695 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 7a03a38c3..a8d3cd886 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 8faa16a00..28f3fc509 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restconf-client - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 790e5b128..49360057e 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-restconf-client - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index 4537098fb..d3123f7ec 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-features - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 09d290044..7f80aa951 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/lighty/pom.xml b/restconf-client/lighty/pom.xml index 7fdf6b8fc..84e940bb5 100755 --- a/restconf-client/lighty/pom.xml +++ b/restconf-client/lighty/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-lighty - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 221987d8c..1da628e8e 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index ab685bb8b..953db6933 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-provider - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index 44c5540f3..c0539c4d2 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sshapi-call-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 893b68a76..6b9827c5c 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-sshapi-call-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 6e31170a7..7e367cea1 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-features - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 1b248a3d6..475da0c7d 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/lighty/pom.xml b/sshapi-call-node/lighty/pom.xml index ecc411424..13c11cd10 100755 --- a/sshapi-call-node/lighty/pom.xml +++ b/sshapi-call-node/lighty/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-lighty - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 4238e7737..1494def32 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index cd920a875..0ad9e2a7b 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-provider - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index 91658ae62..e34106988 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-template-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index 105a03245..11e459d0a 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins features-template-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT feature diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 391a6ce14..40574a1f9 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-features - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index 2a5891dd4..7fbbeec74 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-installer - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/lighty/pom.xml b/template-node/lighty/pom.xml index f9bc94d81..8759f0273 100755 --- a/template-node/lighty/pom.xml +++ b/template-node/lighty/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-lighty - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT jar ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/pom.xml b/template-node/pom.xml index 4149f8746..959d119c4 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins template-node - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT pom diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index f9cd3ef2d..477a539f2 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-provider - 0.6.0-SNAPSHOT + 0.6.1-SNAPSHOT bundle ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/version.properties b/version.properties index 3fc281cbc..24c154ada 100644 --- a/version.properties +++ b/version.properties @@ -7,7 +7,7 @@ release_name=0 sprint_number=6 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From cd53f2f4488e8521cd2461526a66fa7021ef6ced Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 11 Sep 2019 10:41:38 -0400 Subject: Roll versions for Frankfurt development Roll master version for Frankfurt development Change-Id: Ibdc691d8ff93b74ac9bc4baae95c5988dd7e34d4 Issue-ID: CCSDK-1701 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 4 ++-- features/ccsdk-sli-plugins-all/pom.xml | 4 ++-- features/features-sli-plugins/pom.xml | 4 ++-- features/installer/pom.xml | 4 ++-- features/pom.xml | 4 ++-- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 4 ++-- grToolkit/features/features-gr-toolkit/pom.xml | 4 ++-- grToolkit/features/pom.xml | 4 ++-- grToolkit/installer/pom.xml | 4 ++-- grToolkit/model/pom.xml | 4 ++-- grToolkit/pom.xml | 4 ++-- grToolkit/provider/pom.xml | 4 ++-- pom.xml | 4 ++-- properties-node/features/ccsdk-properties-node/pom.xml | 4 ++-- properties-node/features/features-properties-node/pom.xml | 4 ++-- properties-node/features/pom.xml | 4 ++-- properties-node/installer/pom.xml | 4 ++-- properties-node/pom.xml | 4 ++-- properties-node/provider/pom.xml | 4 ++-- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/features-restapi-call-node/pom.xml | 4 ++-- restapi-call-node/features/pom.xml | 4 ++-- restapi-call-node/installer/pom.xml | 4 ++-- restapi-call-node/pom.xml | 4 ++-- restapi-call-node/provider/pom.xml | 4 ++-- restconf-client/features/ccsdk-restconf-client/pom.xml | 4 ++-- restconf-client/features/features-restconf-client/pom.xml | 4 ++-- restconf-client/features/pom.xml | 4 ++-- restconf-client/installer/pom.xml | 4 ++-- restconf-client/pom.xml | 4 ++-- restconf-client/provider/pom.xml | 4 ++-- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/features/pom.xml | 4 ++-- sshapi-call-node/installer/pom.xml | 4 ++-- sshapi-call-node/pom.xml | 4 ++-- sshapi-call-node/provider/pom.xml | 4 ++-- template-node/features/ccsdk-template-node/pom.xml | 4 ++-- template-node/features/features-template-node/pom.xml | 4 ++-- template-node/features/pom.xml | 4 ++-- template-node/installer/pom.xml | 4 ++-- template-node/pom.xml | 4 ++-- template-node/provider/pom.xml | 4 ++-- version.properties | 4 ++-- 44 files changed, 88 insertions(+), 88 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 59e334acf..ef2d3541a 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.plugins sli-plugins-artifacts - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: sli-plugins-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index 1054f1903..fe21e42fe 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins-all - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index dff558c6a..070979220 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-sli-plugins - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 529588c58..5f6d1b442 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-features-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 3780233ec..d551c350a 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins sliplugins-feature-aggregator - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: features diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index 88d931d33..fb5523902 100644 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-gr-toolkit - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index f22ed5d29..3e6c967ad 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-gr-toolkit - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index 37179a551..aebb98e9f 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} gr-toolkit-features org.onap.ccsdk.sli.plugins - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 4d097054f..0fd397232 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,14 +4,14 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-gr-toolkit diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index 646564a90..39239a08c 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-model - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index b55df5cd7..9de96ec8c 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins gr-toolkit - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: gr-toolkit diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index f8228c2b5..d36643a77 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,13 +4,13 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} org.onap.ccsdk.sli.plugins gr-toolkit-provider - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle diff --git a/pom.xml b/pom.xml index 8e9cc52d2..c0be21440 100755 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sli-plugins - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index b80d8f429..c496d20d8 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-properties-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index 485d29534..e25ba5808 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-properties-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 83bc1da13..97f12cf24 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-features - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 3af5efc7a..9ba85b91c 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 0e5d576d3..0c9c28464 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: properties-node diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 262c4968d..059870974 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins properties-node-provider - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-plugins :: properties-node :: ${project.artifactId} diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 6f3109e4d..1100f223b 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restapi-call-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 4350f75b4..26c986a3b 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-restapi-call-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index a49633d5a..6736bd1d2 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-features - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 697cfdcc8..06e77b411 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 5bbd4d7b4..26a237f7b 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: restapi-call-node diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index a8d3cd886..0e6babb39 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins restapi-call-node-provider - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 28f3fc509..276d6e8fb 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-restconf-client - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index 49360057e..d4c78ca35 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-restconf-client - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index d3123f7ec..a5d75807e 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-features - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 7f80aa951..6fb08e311 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 2d1893f6d..9492f9eaf 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: restconf-client diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 953db6933..d6f996ae6 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins restconf-client-provider - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index c0539c4d2..604c4c83d 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-sshapi-call-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 6b9827c5c..32d50d7e1 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-sshapi-call-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 7e367cea1..08c53e084 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-features - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 475da0c7d..94b28f215 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index d46da1973..91fe43507 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: sshapi-call-node diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index 0ad9e2a7b..d616db767 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins sshapi-call-node-provider - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index e34106988..8bf76afa9 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins ccsdk-template-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index 11e459d0a..6934d2f0b 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins features-template-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT feature diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 40574a1f9..9dfebb7e6 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-features - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index 7fbbeec74..92f3bdeaf 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-installer - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/template-node/pom.xml b/template-node/pom.xml index 58a83c841..efcb5efd0 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT pom diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 477a539f2..65df5c6dc 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent binding-parent - 1.4.1-SNAPSHOT + 1.5.0-SNAPSHOT org.onap.ccsdk.sli.plugins template-node-provider - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle ccsdk-sli-plugins :: template-node :: ${project.artifactId} diff --git a/version.properties b/version.properties index 24c154ada..f23ce8f9e 100644 --- a/version.properties +++ b/version.properties @@ -6,8 +6,8 @@ # Comment release_name=0 -sprint_number=6 -feature_revision=1 +sprint_number=7 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From eb00a7cdf2828a3030595e14e142ad1250b45e5b Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Wed, 11 Sep 2019 20:28:15 +0000 Subject: rest api call node content type fix Don't set content-type header when there is no content/body Issue-ID: CCSDK-1703 Signed-off-by: Smokowski, Kevin (ks6305) Change-Id: I247f571bf0d4fc021a1b32936b3dc33473b35f89 --- .../onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 8038b94ce..b93887ffc 100755 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -788,8 +788,6 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { WebTarget webTarget = addAuthType(client, p).target(p.restapiUrl); - log.info("Sending request below to url " + p.restapiUrl); - log.info(request); long t1 = System.currentTimeMillis(); HttpResponse r = new HttpResponse(); @@ -828,7 +826,15 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { Response response; try { - response = invocationBuilder.method(p.httpMethod.toString(), entity(request, contentType)); + // When the HTTP operation has no body do not set the content-type + //setting content-type has caused errors with some servers when no body is present + if (request == null) { + response = invocationBuilder.method(p.httpMethod.toString()); + } else { + log.info("Sending request below to url " + p.restapiUrl); + log.info(request); + response = invocationBuilder.method(p.httpMethod.toString(), entity(request, contentType)); + } } catch (ProcessingException | IllegalStateException e) { throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); } -- cgit 1.2.3-korg From 0eee231b5d1a598e7381be0d733e69357847768f Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Thu, 17 Oct 2019 18:22:47 +0000 Subject: add metric log filter integrate restapicallnode with MetricLogClientFilter Issue-ID: CCSDK-1846 Signed-off-by: Smokowski, Kevin (ks6305) Change-Id: I2be5ff327caedfc93cec31d3273c97aa4f924eb7 --- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 7 +++++++ restapi-call-node/provider/pom.xml | 6 +++++- .../org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java | 5 ++--- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 1100f223b..cd7f0351c 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -27,6 +27,13 @@ ${project.groupId} restapi-call-node-provider ${project.version} + + + + org.onap.logging-analytics + logging-filter-base + + diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 0e6babb39..711597d73 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -65,7 +65,11 @@ org.glassfish.jersey.media jersey-media-multipart - + + org.onap.logging-analytics + logging-filter-base + 1.5.0 + junit diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index b93887ffc..b4d7e1ba8 100755 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -72,6 +72,7 @@ import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.onap.logging.filter.base.MetricLogClientFilter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -785,7 +786,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { setClientTimeouts(client); // Needed to support additional HTTP methods such as PATCH client.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); - + client.register(new MetricLogClientFilter()); WebTarget webTarget = addAuthType(client, p).target(p.restapiUrl); long t1 = System.currentTimeMillis(); @@ -819,8 +820,6 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } } - invocationBuilder.header("X-ECOMP-RequestID", org.slf4j.MDC.get("X-ECOMP-RequestID")); - invocationBuilder.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); Response response; -- cgit 1.2.3-korg From 0edd4f12d88179a9e0c1e304097f1c3f416b5e7f Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Thu, 31 Oct 2019 14:38:02 +0000 Subject: pom updates inherit version for org.onap.logging-analytics artifacts Issue-ID: CCSDK-1882 Signed-off-by: Smokowski, Kevin (ks6305) Change-Id: I0d4d1dce823d9d826ad88eeb8f42e1b61eacc69c --- restapi-call-node/provider/pom.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'restapi-call-node/provider') diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 711597d73..76e7bd238 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -68,7 +68,6 @@ org.onap.logging-analytics logging-filter-base - 1.5.0 -- cgit 1.2.3-korg From 54e11e9ee8bc35cc5e4b9f9b2a72b534e3217f2b Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 13 Nov 2019 10:30:06 -0500 Subject: Use 1.5.0 parent pom Use released 1.5.0 version of parent pom Change-Id: I16d9e82401447829e6b853790553623cc2a03117 Issue-ID: CCSDK-1920 Signed-off-by: Timoney, Dan (dt5972) --- artifacts/pom.xml | 2 +- features/ccsdk-sli-plugins-all/pom.xml | 2 +- features/features-sli-plugins/pom.xml | 2 +- features/installer/pom.xml | 2 +- features/pom.xml | 2 +- grToolkit/features/ccsdk-gr-toolkit/pom.xml | 2 +- grToolkit/features/features-gr-toolkit/pom.xml | 2 +- grToolkit/features/pom.xml | 2 +- grToolkit/installer/pom.xml | 2 +- grToolkit/model/pom.xml | 2 +- grToolkit/pom.xml | 2 +- grToolkit/provider/pom.xml | 2 +- pom.xml | 2 +- properties-node/features/ccsdk-properties-node/pom.xml | 2 +- properties-node/features/features-properties-node/pom.xml | 2 +- properties-node/features/pom.xml | 2 +- properties-node/installer/pom.xml | 2 +- properties-node/pom.xml | 2 +- properties-node/provider/pom.xml | 3 ++- restapi-call-node/features/ccsdk-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/features-restapi-call-node/pom.xml | 2 +- restapi-call-node/features/pom.xml | 2 +- restapi-call-node/installer/pom.xml | 2 +- restapi-call-node/pom.xml | 2 +- restapi-call-node/provider/pom.xml | 2 +- restconf-client/features/ccsdk-restconf-client/pom.xml | 2 +- restconf-client/features/features-restconf-client/pom.xml | 2 +- restconf-client/features/pom.xml | 2 +- restconf-client/installer/pom.xml | 2 +- restconf-client/pom.xml | 2 +- restconf-client/provider/pom.xml | 5 ++--- sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/features-sshapi-call-node/pom.xml | 2 +- sshapi-call-node/features/pom.xml | 2 +- sshapi-call-node/installer/pom.xml | 2 +- sshapi-call-node/pom.xml | 2 +- sshapi-call-node/provider/pom.xml | 5 +++-- template-node/features/ccsdk-template-node/pom.xml | 2 +- template-node/features/features-template-node/pom.xml | 2 +- template-node/features/pom.xml | 2 +- template-node/installer/pom.xml | 2 +- template-node/pom.xml | 2 +- template-node/provider/pom.xml | 2 +- 43 files changed, 47 insertions(+), 46 deletions(-) (limited to 'restapi-call-node/provider') diff --git a/artifacts/pom.xml b/artifacts/pom.xml index ef2d3541a..f52c67ffd 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/features/ccsdk-sli-plugins-all/pom.xml b/features/ccsdk-sli-plugins-all/pom.xml index fe21e42fe..17fa454d5 100644 --- a/features/ccsdk-sli-plugins-all/pom.xml +++ b/features/ccsdk-sli-plugins-all/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/features/features-sli-plugins/pom.xml b/features/features-sli-plugins/pom.xml index 070979220..0a42c4f92 100644 --- a/features/features-sli-plugins/pom.xml +++ b/features/features-sli-plugins/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/features/installer/pom.xml b/features/installer/pom.xml index 5f6d1b442..b5d3d5f20 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/features/pom.xml b/features/pom.xml index d551c350a..b7267c060 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/grToolkit/features/ccsdk-gr-toolkit/pom.xml b/grToolkit/features/ccsdk-gr-toolkit/pom.xml index fb5523902..26a3ae37d 100644 --- a/grToolkit/features/ccsdk-gr-toolkit/pom.xml +++ b/grToolkit/features/ccsdk-gr-toolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/grToolkit/features/features-gr-toolkit/pom.xml b/grToolkit/features/features-gr-toolkit/pom.xml index 3e6c967ad..fa044f74c 100755 --- a/grToolkit/features/features-gr-toolkit/pom.xml +++ b/grToolkit/features/features-gr-toolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/grToolkit/features/pom.xml b/grToolkit/features/pom.xml index aebb98e9f..8a1945bf3 100755 --- a/grToolkit/features/pom.xml +++ b/grToolkit/features/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/grToolkit/installer/pom.xml b/grToolkit/installer/pom.xml index 0fd397232..2b3147426 100755 --- a/grToolkit/installer/pom.xml +++ b/grToolkit/installer/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/grToolkit/model/pom.xml b/grToolkit/model/pom.xml index 39239a08c..56a136b5b 100755 --- a/grToolkit/model/pom.xml +++ b/grToolkit/model/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/grToolkit/pom.xml b/grToolkit/pom.xml index 9de96ec8c..7f21b85fb 100755 --- a/grToolkit/pom.xml +++ b/grToolkit/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index d36643a77..a18054be8 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 ccsdk-sli-plugins :: gr-toolkit :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index c0be21440..919cbe164 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/properties-node/features/ccsdk-properties-node/pom.xml b/properties-node/features/ccsdk-properties-node/pom.xml index c496d20d8..a4f0ce2b8 100644 --- a/properties-node/features/ccsdk-properties-node/pom.xml +++ b/properties-node/features/ccsdk-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/properties-node/features/features-properties-node/pom.xml b/properties-node/features/features-properties-node/pom.xml index e25ba5808..7f25ff685 100644 --- a/properties-node/features/features-properties-node/pom.xml +++ b/properties-node/features/features-properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/properties-node/features/pom.xml b/properties-node/features/pom.xml index 97f12cf24..f7834e1b2 100755 --- a/properties-node/features/pom.xml +++ b/properties-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/properties-node/installer/pom.xml b/properties-node/installer/pom.xml index 9ba85b91c..7d501f7d4 100755 --- a/properties-node/installer/pom.xml +++ b/properties-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/properties-node/pom.xml b/properties-node/pom.xml index 0c9c28464..03fbaebea 100755 --- a/properties-node/pom.xml +++ b/properties-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index 059870974..a2a27eb5b 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins @@ -15,6 +15,7 @@ ccsdk-sli-plugins :: properties-node :: ${project.artifactId} + diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index cd7f0351c..bba917c94 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/restapi-call-node/features/features-restapi-call-node/pom.xml b/restapi-call-node/features/features-restapi-call-node/pom.xml index 26c986a3b..a98d96737 100644 --- a/restapi-call-node/features/features-restapi-call-node/pom.xml +++ b/restapi-call-node/features/features-restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/restapi-call-node/features/pom.xml b/restapi-call-node/features/pom.xml index 6736bd1d2..9df843837 100755 --- a/restapi-call-node/features/pom.xml +++ b/restapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml index 06e77b411..1d9594ffb 100755 --- a/restapi-call-node/installer/pom.xml +++ b/restapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/pom.xml b/restapi-call-node/pom.xml index 26a237f7b..5997af7a2 100755 --- a/restapi-call-node/pom.xml +++ b/restapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 76e7bd238..bda6b00e9 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/features/ccsdk-restconf-client/pom.xml b/restconf-client/features/ccsdk-restconf-client/pom.xml index 276d6e8fb..831b59760 100644 --- a/restconf-client/features/ccsdk-restconf-client/pom.xml +++ b/restconf-client/features/ccsdk-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/restconf-client/features/features-restconf-client/pom.xml b/restconf-client/features/features-restconf-client/pom.xml index d4c78ca35..6f241b633 100644 --- a/restconf-client/features/features-restconf-client/pom.xml +++ b/restconf-client/features/features-restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/restconf-client/features/pom.xml b/restconf-client/features/pom.xml index a5d75807e..1888dd77c 100755 --- a/restconf-client/features/pom.xml +++ b/restconf-client/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/installer/pom.xml b/restconf-client/installer/pom.xml index 6fb08e311..26775a835 100755 --- a/restconf-client/installer/pom.xml +++ b/restconf-client/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/pom.xml b/restconf-client/pom.xml index 9492f9eaf..e84258746 100755 --- a/restconf-client/pom.xml +++ b/restconf-client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index ec9e151e8..487bdf9b5 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index 604c4c83d..d16c6ff32 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/sshapi-call-node/features/features-sshapi-call-node/pom.xml b/sshapi-call-node/features/features-sshapi-call-node/pom.xml index 32d50d7e1..54bc88dc4 100644 --- a/sshapi-call-node/features/features-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/features-sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/sshapi-call-node/features/pom.xml b/sshapi-call-node/features/pom.xml index 08c53e084..af7901236 100755 --- a/sshapi-call-node/features/pom.xml +++ b/sshapi-call-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/installer/pom.xml b/sshapi-call-node/installer/pom.xml index 94b28f215..613886aee 100755 --- a/sshapi-call-node/installer/pom.xml +++ b/sshapi-call-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/pom.xml b/sshapi-call-node/pom.xml index 91fe43507..14d374a0c 100755 --- a/sshapi-call-node/pom.xml +++ b/sshapi-call-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/sshapi-call-node/provider/pom.xml b/sshapi-call-node/provider/pom.xml index d616db767..641e9af1e 100755 --- a/sshapi-call-node/provider/pom.xml +++ b/sshapi-call-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins @@ -14,7 +14,8 @@ bundle ccsdk-sli-plugins :: sshapi-call-node :: ${project.artifactId} - + + diff --git a/template-node/features/ccsdk-template-node/pom.xml b/template-node/features/ccsdk-template-node/pom.xml index 8bf76afa9..a8cb85aaf 100644 --- a/template-node/features/ccsdk-template-node/pom.xml +++ b/template-node/features/ccsdk-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/template-node/features/features-template-node/pom.xml b/template-node/features/features-template-node/pom.xml index 6934d2f0b..65837d5e1 100644 --- a/template-node/features/features-template-node/pom.xml +++ b/template-node/features/features-template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.5.0-SNAPSHOT + 1.5.0 diff --git a/template-node/features/pom.xml b/template-node/features/pom.xml index 9dfebb7e6..77409f694 100644 --- a/template-node/features/pom.xml +++ b/template-node/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/template-node/installer/pom.xml b/template-node/installer/pom.xml index 92f3bdeaf..53a1ff55d 100644 --- a/template-node/installer/pom.xml +++ b/template-node/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/template-node/pom.xml b/template-node/pom.xml index efcb5efd0..c007e3ce7 100644 --- a/template-node/pom.xml +++ b/template-node/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins diff --git a/template-node/provider/pom.xml b/template-node/provider/pom.xml index 65df5c6dc..3d470c0af 100644 --- a/template-node/provider/pom.xml +++ b/template-node/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.5.0-SNAPSHOT + 1.5.0 org.onap.ccsdk.sli.plugins -- cgit 1.2.3-korg From bf59c3a6e1ae0ce2dd1703688f9f4e712d75e193 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 19 Nov 2019 13:23:49 -0500 Subject: Fix versions of sli core dependencies Fix to override ccsdk sli core version from parent pom with current version Change-Id: I0d4dfad609fb7c838d3750ef36b8656ad102dda6 Issue-ID: CCSDK-1944 Signed-off-by: Timoney, Dan (dt5972) --- grToolkit/provider/pom.xml | 4 ++++ properties-node/provider/pom.xml | 3 +++ restapi-call-node/provider/pom.xml | 4 ++++ restconf-client/provider/pom.xml | 4 ++++ sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml | 4 ++++ sshapi-call-node/provider/pom.xml | 3 +++ template-node/provider/pom.xml | 4 ++++ 7 files changed, 26 insertions(+) (limited to 'restapi-call-node/provider') diff --git a/grToolkit/provider/pom.xml b/grToolkit/provider/pom.xml index a18054be8..8f5f17da0 100755 --- a/grToolkit/provider/pom.xml +++ b/grToolkit/provider/pom.xml @@ -13,6 +13,10 @@ 0.7.0-SNAPSHOT bundle + + ${project.version} + + diff --git a/properties-node/provider/pom.xml b/properties-node/provider/pom.xml index a2a27eb5b..1a2afbcb3 100755 --- a/properties-node/provider/pom.xml +++ b/properties-node/provider/pom.xml @@ -15,6 +15,9 @@ ccsdk-sli-plugins :: properties-node :: ${project.artifactId} + + ${project.version} + diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index bda6b00e9..6c956c6a1 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -15,6 +15,10 @@ ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} + + ${project.version} + + diff --git a/restconf-client/provider/pom.xml b/restconf-client/provider/pom.xml index 487bdf9b5..0321f07b0 100755 --- a/restconf-client/provider/pom.xml +++ b/restconf-client/provider/pom.xml @@ -15,6 +15,10 @@ ccsdk-sli-plugins :: restconf-client :: ${project.artifactId} + + ${project.version} + + diff --git a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml index d16c6ff32..6dfe13997 100644 --- a/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml +++ b/sshapi-call-node/features/ccsdk-sshapi-call-node/pom.xml @@ -19,6 +19,10 @@