diff options
author | kurczews <krzysztof.kurczewski@nokia.com> | 2019-01-07 07:10:10 +0100 |
---|---|---|
committer | kurczews <krzysztof.kurczewski@nokia.com> | 2019-01-07 07:27:21 +0100 |
commit | e64f08ac8242a7db6eb3238ee0ad1a30c8aecf0d (patch) | |
tree | d152c7418987fe79260943a6c8b1467d201f69cb /local-setup/src | |
parent | 57a4c074857c33ba74dcce1ae4818e56ceb6c603 (diff) |
Add simplified local setup
Simplify local setup described at:
https://wiki.onap.org/display/DW/AAI+Developer+Environment+Setup+-+Casablanca
* simplified janus-server setup
* simplified haproxy setup
* added docker-compose
* introduce automatic tests for containers
* added run instruction
Issue-ID: AAI-2049
Change-Id: I7c033c6a4464f3da94bdf11566060693c0f8b005
Signed-off-by: kurczews <krzysztof.kurczewski@nokia.com>
Diffstat (limited to 'local-setup/src')
20 files changed, 1197 insertions, 0 deletions
diff --git a/local-setup/src/main/docker/docker-compose.yml b/local-setup/src/main/docker/docker-compose.yml new file mode 100644 index 0000000..28e7360 --- /dev/null +++ b/local-setup/src/main/docker/docker-compose.yml @@ -0,0 +1,23 @@ +version: '2' + +services: + + aai-storage: + image: onap/aai-janus-dev + container_name: aai-storage + network_mode: host + + aai-resources: + image: onap/aai-resources + container_name: aai-resources + network_mode: host + + aai-traversal: + image: onap/aai-traversal + container_name: aai-traversal + network_mode: host + + aai-haproxy: + image: onap/aai-haproxy-dev + container_name: aai-haproxy + network_mode: host
\ No newline at end of file diff --git a/local-setup/src/main/docker/haproxy/Dockerfile b/local-setup/src/main/docker/haproxy/Dockerfile new file mode 100644 index 0000000..121b698 --- /dev/null +++ b/local-setup/src/main/docker/haproxy/Dockerfile @@ -0,0 +1,9 @@ +FROM haproxy:1.6-alpine + +WORKDIR app/ + +COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg + +COPY aai.pem /etc/ssl/private/aai.pem + +RUN chmod 640 /etc/ssl/private/aai.pem && chown root:root /etc/ssl/private/aai.pem
\ No newline at end of file diff --git a/local-setup/src/main/docker/haproxy/aai.pem b/local-setup/src/main/docker/haproxy/aai.pem new file mode 100644 index 0000000..ce97d30 --- /dev/null +++ b/local-setup/src/main/docker/haproxy/aai.pem @@ -0,0 +1,84 @@ +-----BEGIN CERTIFICATE----- +MIIFEjCCA/qgAwIBAgIBBjANBgkqhkiG9w0BAQsFADBHMQswCQYDVQQGEwJVUzEN +MAsGA1UECgwET05BUDEOMAwGA1UECwwFT1NBQUYxGTAXBgNVBAMMEGludGVybWVk +aWF0ZUNBXzEwHhcNMTgwNjA1MTIxOTU5WhcNMTkwNTMxMTIxOTU5WjBVMQswCQYD +VQQGEwJVUzENMAsGA1UECgwET05BUDEZMBcGA1UECwwQYWFpQGFhaS5vbmFwLm9y +ZzEOMAwGA1UECwwFT1NBQUYxDDAKBgNVBAMMA2FhaTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAMqVPBjn6pxPhAwRov+ApKxJkuSo/UNbwmc7eYC+eYiY +SB35uI7Bt8UHWxxBNZdHpFbZUOuL2wWb7JYycML8gbsY2YF440K+X+TVTiVGSkv0 +L8MYwDTuCOn9YtlTEkKE6Wth4WPyEN3ZrQD7j7YGNr/3tK61Eeq/A/qhhksbpuTu +ReRDdsXzXTwX2sjZXdixv25YJUStH1pSrAHLzM/meeuRoGxq29lj2b5HUW5epc+Y +D9hd4sKn7Irsv+cLQ1fVtYUSm/kFdygJQGiyi9Bst5ysY2/h+4AWVxzLQ4jjd1NJ +LM6v8wfV4eTw2qO5+Gd1Bjax13YySKIRnlOffySOtZ0CAwEAAaOCAfkwggH1MAkG +A1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgbAMDMGCWCGSAGG+EIBDQQmFiRPcGVu +U1NMIEdlbmVyYXRlZCBTZXJ2ZXIgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFL+SSLja +c4UNR6q1VUmj+jcRNbeJMFQGA1UdIwRNMEuAFBrUV3JwStNnqevh3GIxsofQ/u+q +oTCkLjAsMQ4wDAYDV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wduIji2Pwfjo9fAaoDckhTCoAa20NkUHeyg/CNDV28hHeeP+1zHX4B +x4VZTYKmXxfpjZ6pMmSHlHMrcrNg1GXw4UHY7L6LBKhNWVDdpY5lydRD/PD6I6tr +JeLVTzIVDW/f1EIS4NJYUdshYFkCgYEA4gOXj1lHeKy8GpGvTncnFIHexKAne1ri +P1UDIUzpI10zD49EG441hwE5ing4tUQe3dH2QZRTI8f/QF3MQdo0cDLf3QMUG2y4 +Ud5XpD+ppyueI7ZLbufm+s2JZlWvv5UcCYbH4mnMPnrUxyCFabgbqvTWgOiJ1GbS +VwvMCAJO9uUCgYEA3jg9/4GS72zVPr0Qaa39AskfIGy2t9kxwCxjr1+gBe+NyObM +LTYlTEW258sUQnz7TX+DK9Lgmk6ullhLBtxYwR0PXLa+xB1tBNWhDB6BbGLWGrzj +DHQFzjk2TvtjdWVAUq5WW6FLerIxvcusSBOmuzzocIvw/BJFUB/F0vhiGXkCgYAw +nLUsj/dfbUfILy2Vous07foMMKZNUe730EEsGG7MvG8PGbF8e8nnj8vgjJsl4dEB +xPdCg7SeLZYpMgOM5nIA7/BWiSL6AxhiA4C2QzsqSadp5vuyjw6PQ0YaTLPQcTHm +mqbDfB4CEklRyxzm8EKDMsYwU9PRa4wyTMdFsblqQQKBgAwy06uFXXdXnoA3PI7J +EJwRkChV4kR0dspAhIZsdfY6yw606IB+NvT48S5gLvMpxC8JGrCjKUkcw4e7lO+c +oxIjEwLmqqYRktRTfWU6SeqrGiiS6/+jERVdVxJysF/0havDkXr27rymiCKb2k2F +82R57RzJC+AYRYrpsJH8dMuA +-----END PRIVATE KEY-----
\ No newline at end of file diff --git a/local-setup/src/main/docker/haproxy/haproxy.cfg b/local-setup/src/main/docker/haproxy/haproxy.cfg new file mode 100644 index 0000000..0fecea0 --- /dev/null +++ b/local-setup/src/main/docker/haproxy/haproxy.cfg @@ -0,0 +1,120 @@ +global + log /dev/log local0 + stats socket /usr/local/etc/haproxy/haproxy.socket mode 660 level admin + stats timeout 30s + user root + group root + daemon + ################################# + # Default SSL material locations# + ################################# + ca-base /etc/ssl/certs + crt-base /etc/ssl/private + + # Default ciphers to use on SSL-enabled listening sockets. + # For more information, see ciphers(1SSL). This list is from: + # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ + # An alternative list with additional directives can be obtained from + # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy + tune.ssl.default-dh-param 2048 + +defaults + log global + mode http + option httplog +# option dontlognull +# errorfile 400 /etc/haproxy/errors/400.http +# errorfile 403 /etc/haproxy/errors/403.http +# errorfile 408 /etc/haproxy/errors/408.http +# errorfile 500 /etc/haproxy/errors/500.http +# errorfile 502 /etc/haproxy/errors/502.http +# errorfile 503 /etc/haproxy/errors/503.http +# errorfile 504 /etc/haproxy/errors/504.http + + option http-server-close + option forwardfor except 127.0.0.1 + retries 6 + option redispatch + maxconn 50000 + timeout connect 50000 + timeout client 480000 + timeout server 480000 + timeout http-keep-alive 30000 + + +frontend IST_8443 + mode http + bind 0.0.0.0:8443 name https ssl crt /etc/ssl/private/aai.pem +# log-format %ci:%cp\ [%t]\ %ft\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %ST\ %B\ %CC\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ {%[ssl_c_verify],%{+Q}[ssl_c_s_dn],%{+Q}[ssl_c_i_dn]}\ %{+Q}r + log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC \ %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r" + option httplog + log global + option logasap + option forwardfor + capture request header Host len 100 + capture response header Host len 100 + option log-separate-errors + option forwardfor + http-request set-header X-Forwarded-Proto https if { ssl_fc } + http-request set-header X-AAI-Client-SSL TRUE if { ssl_c_used } + http-request set-header X-AAI-SSL %[ssl_fc] + http-request set-header X-AAI-SSL-Client-Verify %[ssl_c_verify] + http-request set-header X-AAI-SSL-Client-DN %{+Q}[ssl_c_s_dn] + http-request set-header X-AAI-SSL-Client-CN %{+Q}[ssl_c_s_dn(cn)] + http-request set-header X-AAI-SSL-Issuer %{+Q}[ssl_c_i_dn] + http-request set-header X-AAI-SSL-Client-NotBefore %{+Q}[ssl_c_notbefore] + http-request set-header X-AAI-SSL-Client-NotAfter %{+Q}[ssl_c_notafter] + http-request set-header X-AAI-SSL-ClientCert-Base64 %{+Q}[ssl_c_der,base64] + http-request set-header X-AAI-SSL-Client-OU %{+Q}[ssl_c_s_dn(OU)] + http-request set-header X-AAI-SSL-Client-L %{+Q}[ssl_c_s_dn(L)] + http-request set-header X-AAI-SSL-Client-ST %{+Q}[ssl_c_s_dn(ST)] + http-request set-header X-AAI-SSL-Client-C %{+Q}[ssl_c_s_dn(C)] + http-request set-header X-AAI-SSL-Client-O %{+Q}[ssl_c_s_dn(O)] + reqadd X-Forwarded-Proto:\ https + reqadd X-Forwarded-Port:\ 8443 + +####################### +#ACLS FOR PORT 8446#### +####################### + + acl is_Port_8446_generic path_reg -i ^/aai/v[0-9]+/search/generic-query$ + acl is_Port_8446_nodes path_reg -i ^/aai/v[0-9]+/search/nodes-query$ + acl is_Port_8446_version path_reg -i ^/aai/v[0-9]+/query$ + acl is_named-query path_beg -i /aai/search/named-query + acl is_search-model path_beg -i /aai/search/model + use_backend IST_AAI_8446 if is_Port_8446_generic or is_Port_8446_nodes or is_Port_8446_version or is_named-query or is_search-model + + default_backend IST_Default_8447 + + +####################### +#DEFAULT BACKEND 847### +####################### + +backend IST_Default_8447 + balance roundrobin + http-request set-header X-Forwarded-Port %[src_port] + http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload; + server aai-resources.api.simpledemo.openecomp.org localhost:8447 port 8447 ssl verify none + +####################### +# BACKEND 8446######### +####################### + +backend IST_AAI_8446 + balance roundrobin + http-request set-header X-Forwarded-Port %[src_port] + http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload; + server aai-traversal.api.simpledemo.openecomp.org localhost:8446 port 8446 ssl verify none + +listen IST_AAI_STATS + mode http + bind *:8080 + stats uri /stats + stats enable + stats refresh 30s + stats hide-version + stats auth admin:admin + stats show-legends + stats show-desc IST AAI APPLICATION NODES + stats admin if TRUE
\ No newline at end of file diff --git a/local-setup/src/main/docker/janusgraph/Dockerfile b/local-setup/src/main/docker/janusgraph/Dockerfile new file mode 100644 index 0000000..76c3628 --- /dev/null +++ b/local-setup/src/main/docker/janusgraph/Dockerfile @@ -0,0 +1,37 @@ +FROM alpine:3.7 + +WORKDIR app/ + +RUN apk add --no-cache \ + bash \ + openjdk8 \ + unzip \ + wget + +ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/bin/ + +ARG JANUS_VERSION=0.2.0 +ARG JANUS_ARTIFACT=janusgraph-${JANUS_VERSION}-hadoop2 + +RUN wget -q --show-progress --progress=bar:force:noscroll \ + http://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/${JANUS_ARTIFACT}.zip && \ + unzip ${JANUS_ARTIFACT}.zip && \ + rm ${JANUS_ARTIFACT}.zip && \ + mv ${JANUS_ARTIFACT} janusgraph + +# WARN: Instruction above takes long time. Make best effort to insert additional commands below this comment + +CMD ["./entrypoint.sh"] + +COPY entrypoint.sh . + +RUN chmod +x entrypoint.sh + +ARG USER=janusz +ARG GROUP=aai + +RUN addgroup ${GROUP} && adduser -D ${USER} ${GROUP} && chown -R ${USER}:${GROUP} . + +USER ${USER}:${GROUP} + +HEALTHCHECK --interval=40s --timeout=10s --retries=3 CMD janusgraph/bin/janusgraph.sh status
\ No newline at end of file diff --git a/local-setup/src/main/docker/janusgraph/entrypoint.sh b/local-setup/src/main/docker/janusgraph/entrypoint.sh new file mode 100755 index 0000000..8108866 --- /dev/null +++ b/local-setup/src/main/docker/janusgraph/entrypoint.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# run short-living command and prevent docker from stopping + +JANUS_EXEC="janusgraph/bin/janusgraph.sh" + +onStart() { + ${JANUS_EXEC} start +} + +onStop() { + ${JANUS_EXEC} stop +} + +waitLoop() { + tail -f /dev/null & + wait $! +} + +trap 'onStop; exit 0' SIGTERM SIGINT + +onStart || exit $? + +waitLoop
\ No newline at end of file diff --git a/local-setup/src/main/java/onap/aai/dto/Model.java b/local-setup/src/main/java/onap/aai/dto/Model.java new file mode 100644 index 0000000..1cf9a41 --- /dev/null +++ b/local-setup/src/main/java/onap/aai/dto/Model.java @@ -0,0 +1,93 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2018-2019 Nokia 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 onap.aai.dto; + +import java.util.Arrays; +import java.util.List; + +/** + * Dummy model for testing purposes + */ +@SuppressWarnings("unused") +public class Model { + + private static final String MODEL_TYPE = "widget"; + private static final String MODEL_VERSION = "1.0"; + + private final String modelInvariantId; + private final String modelType; + private final ModelVers modelVers; + + public Model(String modelName, String modelInvariantId, String modelVersionId) { + this.modelInvariantId = modelInvariantId; + this.modelVers = new ModelVers(new ModelVer(modelVersionId, modelName)); + this.modelType = MODEL_TYPE; + } + + public String getModelInvariantId() { + return modelInvariantId; + } + + public ModelVers getModelVers() { + return modelVers; + } + + public String getModelType() { + return modelType; + } + + private static class ModelVers { + + private final List<ModelVer> modelVer; + + ModelVers(ModelVer... modelVer) { + this.modelVer = Arrays.asList(modelVer); + } + + public List<ModelVer> getModelVer() { + return modelVer; + } + } + + private static class ModelVer { + + private final String modelVersionId; + private final String modelVersion; + private final String modelName; + + ModelVer(String modelVersionId, String modelName) { + this.modelVersionId = modelVersionId; + this.modelName = modelName; + this.modelVersion = MODEL_VERSION; + } + + public String getModelVersionId() { + return modelVersionId; + } + + public String getModelName() { + return modelName; + } + + public String getModelVersion() { + return MODEL_VERSION; + } + } +}
\ No newline at end of file diff --git a/local-setup/src/main/java/onap/aai/dto/ModelGenerator.java b/local-setup/src/main/java/onap/aai/dto/ModelGenerator.java new file mode 100644 index 0000000..c6625e1 --- /dev/null +++ b/local-setup/src/main/java/onap/aai/dto/ModelGenerator.java @@ -0,0 +1,48 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2018-2019 Nokia 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 onap.aai.dto; + +import static onap.aai.util.Resources.readerFrom; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.stream.Stream; +import org.apache.commons.csv.CSVFormat; +import org.apache.commons.csv.CSVParser; +import org.apache.commons.csv.CSVRecord; + +public class ModelGenerator { + + public static Stream<Model> generate(String fileName) { + try (CSVParser parser = CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(readerFrom(fileName))) { + return parser.getRecords().stream().map(ModelGenerator::csvToModel); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private static Model csvToModel(CSVRecord csvRecord) { + return new Model( + csvRecord.get("model-name"), + csvRecord.get("model-invariant-id"), + csvRecord.get("model-version-id") + ); + } +} diff --git a/local-setup/src/main/java/onap/aai/util/AaiRequest.java b/local-setup/src/main/java/onap/aai/util/AaiRequest.java new file mode 100644 index 0000000..1875e41 --- /dev/null +++ b/local-setup/src/main/java/onap/aai/util/AaiRequest.java @@ -0,0 +1,62 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2018-2019 Nokia 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 onap.aai.util; + +import com.github.kevinsawicki.http.HttpRequest; + +public class AaiRequest { + + private static final String AAI_BASE_URL = "https://localhost:8443/aai"; + private static final String AAI_AUTH = "Basic QUFJOkFBSQ=="; + private static final String SCHEMA_VERSION = "/v14"; + + public static HttpRequest get(String endpoint) { + return aaiRequest(HttpRequest.get(aaiEndpoint(endpoint))); + } + + public static HttpRequest post(String endpoint) { + return aaiRequest(HttpRequest.post(aaiEndpoint(endpoint))); + } + + public static HttpRequest put(String endpoint) { + return aaiRequest(HttpRequest.put(aaiEndpoint(endpoint))); + } + + public static HttpRequest delete(String endpoint) { + return aaiRequest(HttpRequest.delete(aaiEndpoint(endpoint))); + } + + public static String v14(String endpoint) { + return SCHEMA_VERSION + endpoint; + } + + private static HttpRequest aaiRequest(HttpRequest httpRequest) { + return httpRequest + .header("X-FromAppId", "dummy id") + .header("X-TransactionId", "1234") + .authorization(AAI_AUTH) + .trustAllCerts() + .trustAllHosts(); + } + + private static String aaiEndpoint(String endpoint) { + return AAI_BASE_URL + endpoint; + } +}
\ No newline at end of file diff --git a/local-setup/src/main/java/onap/aai/util/Resources.java b/local-setup/src/main/java/onap/aai/util/Resources.java new file mode 100644 index 0000000..54d21ec --- /dev/null +++ b/local-setup/src/main/java/onap/aai/util/Resources.java @@ -0,0 +1,40 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2018-2019 Nokia 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 onap.aai.util; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.stream.Collectors; + +public class Resources { + + public static InputStream inputStreamFrom(String fileName) { + return Resources.class.getClassLoader().getResourceAsStream(fileName); + } + + public static BufferedReader readerFrom(String fileName) { + return new BufferedReader(new InputStreamReader(inputStreamFrom(fileName))); + } + + public static String rawTextFrom(String fileName) { + return readerFrom(fileName).lines().collect(Collectors.joining()); + } +} diff --git a/local-setup/src/test/java/onap/aai/AaiResourcesIT.java b/local-setup/src/test/java/onap/aai/AaiResourcesIT.java new file mode 100644 index 0000000..7d8055f --- /dev/null +++ b/local-setup/src/test/java/onap/aai/AaiResourcesIT.java @@ -0,0 +1,98 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2018-2019 Nokia 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 onap.aai; + +import static java.net.HttpURLConnection.HTTP_CREATED; +import static java.net.HttpURLConnection.HTTP_NOT_FOUND; +import static java.net.HttpURLConnection.HTTP_NO_CONTENT; +import static java.net.HttpURLConnection.HTTP_OK; +import static onap.aai.util.AaiRequest.v14; +import static onap.aai.util.Resources.inputStreamFrom; +import static org.assertj.core.api.Assertions.assertThat; + +import com.github.kevinsawicki.http.HttpRequest; +import com.jayway.jsonpath.JsonPath; +import onap.aai.util.AaiRequest; +import org.junit.After; +import org.junit.Test; + +public class AaiResourcesIT { + + private String id; + + @After + public void tearDown() { + if (id != null && !id.isEmpty()) { + AaiRequest.delete(v14("/cloud-infrastructure/complexes/complex/clli2?resource-version=" + id)); + } + } + + @Test + public void aai_resources_docker_test() { + System.out.println("Get complexes..."); + assert_getComplexes_returns_notFound(); + + System.out.println("Adding complex..."); + assert_putComplex_returns_created(); + + System.out.println("Get complexes..."); + id = assert_getComplexes_returns_complex(); + + System.out.println("Remove complex..."); + assert_deleteComplex_returns_noContent(id); + + System.out.println("Get complex..."); + assert_getComplexes_returns_notFound(); + } + + private void assert_getComplexes_returns_notFound() { + HttpRequest request = AaiRequest.get(v14("/cloud-infrastructure/complexes")); + + assertThat(request.code()).isEqualTo(HTTP_NOT_FOUND); + assertThat(request.body()).contains("requestError"); + } + + private void assert_putComplex_returns_created() { + HttpRequest request = AaiRequest + .put(v14("/cloud-infrastructure/complexes/complex/clli2")) + .send(inputStreamFrom("complex_data.json")); + + assertThat(request.code()).isEqualTo(HTTP_CREATED); + } + + private String assert_getComplexes_returns_complex() { + HttpRequest request = AaiRequest.get(v14("/cloud-infrastructure/complexes")) + .acceptJson(); + + assertThat(request.code()).isEqualTo(HTTP_OK); + String body = request.body(); + + assertThat(body).contains("clli2").contains("resource-version"); + + return JsonPath.read(body, "$.complex.[0].resource-version"); + } + + private void assert_deleteComplex_returns_noContent(String id) { + HttpRequest request = AaiRequest + .delete(v14("/cloud-infrastructure/complexes/complex/clli2?resource-version=" + id)); + + assertThat(request.code()).isEqualTo(HTTP_NO_CONTENT); + } +}
\ No newline at end of file diff --git a/local-setup/src/test/java/onap/aai/AaiTraversalIT.java b/local-setup/src/test/java/onap/aai/AaiTraversalIT.java new file mode 100644 index 0000000..8fdb74a --- /dev/null +++ b/local-setup/src/test/java/onap/aai/AaiTraversalIT.java @@ -0,0 +1,127 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2018-2019 Nokia 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 onap.aai; + +import static com.fasterxml.jackson.databind.PropertyNamingStrategy.KEBAB_CASE; +import static java.net.HttpURLConnection.HTTP_CREATED; +import static java.net.HttpURLConnection.HTTP_OK; +import static onap.aai.util.AaiRequest.v14; +import static onap.aai.util.Resources.inputStreamFrom; +import static onap.aai.util.Resources.rawTextFrom; +import static org.assertj.core.api.Assertions.assertThat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.kevinsawicki.http.HttpRequest; +import java.io.UncheckedIOException; +import onap.aai.dto.Model; +import onap.aai.dto.ModelGenerator; +import onap.aai.util.AaiRequest; +import org.json.JSONException; +import org.junit.Before; +import org.junit.Test; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; + +public class AaiTraversalIT { + + private static final String APPLICATION_XML = "application/xml"; + + private final ObjectMapper objectMapper = new ObjectMapper().setPropertyNamingStrategy(KEBAB_CASE); + + @Before + public void prepare_aai_resources() throws Exception { + Model model = new Model("action", "123", "456"); + assertThat(objectMapper.writeValueAsString(model)) + .isEqualToIgnoringWhitespace(rawTextFrom("example_model.json")); + + System.out.println("Adding models..."); + assert_putModels_succeed(); + + System.out.println("Adding query..."); + assert_putQuery_returns_created(); + + System.out.println("Adding customer..."); + assert_putCustomer_returns_created(); + + System.out.println("Adding VNF..."); + assert_putVnf_returns_created(); + } + + @Test + public void aai_traversal_docker_test() throws Exception { + assert_postQuery_returns_inventory(); + } + + private void assert_putModels_succeed() { + ModelGenerator + .generate("models.csv") + .forEach(this::assert_putModel_returns_created); + } + + private void assert_putModel_returns_created(Model model) { + HttpRequest request; + try { + request = AaiRequest + .put(v14("/service-design-and-creation/models/model/" + model.getModelInvariantId())) + .send(objectMapper.writeValueAsString(model)); + } catch (JsonProcessingException e) { + throw new UncheckedIOException(e); + } + + assertThat(request.code()).isEqualTo(HTTP_CREATED); + } + + private void assert_putQuery_returns_created() { + HttpRequest request = AaiRequest + .put(v14("/service-design-and-creation/named-queries/named-query/0367193e-c785-4d5f-9cb8-7bc89dc9ddb7")) + .send(inputStreamFrom("create_query.json")); + + assertThat(request.code()).isEqualTo(HTTP_CREATED); + } + + private void assert_putCustomer_returns_created() { + HttpRequest request = AaiRequest + .put(v14("/business/customers/customer/aai_demo_for_onap_community")) + .contentType(APPLICATION_XML) + .send(inputStreamFrom("add_customer.xml")); + + assertThat(request.code()).isEqualTo(HTTP_CREATED); + } + + private void assert_putVnf_returns_created() { + HttpRequest request = AaiRequest + .put(v14("/network/generic-vnfs/generic-vnf/de7cc3ab-0212-47df-9e64-da1c79234deb")) + .contentType(APPLICATION_XML) + .send(inputStreamFrom("add_generic_vnf.xml")); + + assertThat(request.code()).isEqualTo(HTTP_CREATED); + } + + private void assert_postQuery_returns_inventory() throws JSONException { + HttpRequest request = AaiRequest + .post("/search/named-query") + .contentType(HttpRequest.CONTENT_TYPE_JSON) + .send(inputStreamFrom("execute_query.json")); + + assertThat(request.code()).isEqualTo(HTTP_OK); + JSONAssert.assertEquals(rawTextFrom("query_response.json"), request.body(), JSONCompareMode.LENIENT); + } +}
\ No newline at end of file diff --git a/local-setup/src/test/resources/add_customer.xml b/local-setup/src/test/resources/add_customer.xml new file mode 100644 index 0000000..402c063 --- /dev/null +++ b/local-setup/src/test/resources/add_customer.xml @@ -0,0 +1,18 @@ +<customer xmlns="http://org.onap.aai.inventory/v14"> + <global-customer-id>aai_demo_for_onap_community</global-customer-id> + <subscriber-name>AAI Demo for ONAP Community</subscriber-name> + <service-subscriptions> + <service-subscription> + <service-type>vDNS</service-type> + <service-instances> + <service-instance> + <service-instance-id>37b8cdb7-94eb-468f-a0c2-4e3c3546578e</service-instance-id> + <service-instance-name>Demo Service Instance</service-instance-name> + <model-invariant-id>82194af1-3c2c-485a-8f44-420e22a9eaa4</model-invariant-id> + <model-version-id>46b92144-923a-4d20-b85a-3cbd847668a9</model-version-id> + <orchestration-status>Active</orchestration-status> + </service-instance> + </service-instances> + </service-subscription> + </service-subscriptions> +</customer>
\ No newline at end of file diff --git a/local-setup/src/test/resources/add_generic_vnf.xml b/local-setup/src/test/resources/add_generic_vnf.xml new file mode 100644 index 0000000..ca3e168 --- /dev/null +++ b/local-setup/src/test/resources/add_generic_vnf.xml @@ -0,0 +1,38 @@ +<generic-vnf xmlns="http://org.onap.aai.inventory/v14"> + <vnf-id>de7cc3ab-0212-47df-9e64-da1c79234deb</vnf-id> + <vnf-name>ZRDM2MMEX39</vnf-name> + <vnf-type>vMME Svc Jul 14/vMME VF Jul 14 1</vnf-type> + <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> + <orchestration-status>active</orchestration-status> + <in-maint>false</in-maint> + <is-closed-loop-disabled>false</is-closed-loop-disabled> + <model-invariant-id>82194af1-3c2c-485a-8f44-420e22a9eaa4</model-invariant-id> + <model-version-id>46b92144-923a-4d20-b85a-3cbd847668a9</model-version-id> + <relationship-list> + <relationship> + <related-to>service-instance</related-to> + <relationship-data> + <relationship-key>customer.global-customer-id</relationship-key> + <relationship-value>aai_demo_for_onap_community</relationship-value> + </relationship-data> + <relationship-data> + <relationship-key>service-subscription.service-type</relationship-key> + <relationship-value>vDNS</relationship-value> + </relationship-data> + <relationship-data> + <relationship-key>service-instance.service-instance-id</relationship-key> + <relationship-value>37b8cdb7-94eb-468f-a0c2-4e3c3546578e</relationship-value> + </relationship-data> + </relationship> + </relationship-list> + <vf-modules> + <vf-module> + <vf-module-id>ef71d47a-53e8-40f4-a5ed-7d2cac1b20f1</vf-module-id> + <vf-module-name>ZRDM2MMEX39_base</vf-module-name> + <orchestration-status>pending-create</orchestration-status> + <is-base-vf-module>true</is-base-vf-module> + <model-invariant-id>82194af1-3c2c-485a-8f44-420e22a9eaa4</model-invariant-id> + <model-version-id>46b92144-923a-4d20-b85a-3cbd847668a9</model-version-id> + </vf-module> + </vf-modules> +</generic-vnf>
\ No newline at end of file diff --git a/local-setup/src/test/resources/complex_data.json b/local-setup/src/test/resources/complex_data.json new file mode 100644 index 0000000..baf2e3b --- /dev/null +++ b/local-setup/src/test/resources/complex_data.json @@ -0,0 +1,18 @@ +{ + "physical-location-id": "clli2", + "data-center-code": "example-data-center-code-val-6667", + "complex-name": "clli2", + "identity-url": "example-identity-url-val-28399", + "physical-location-type": "example-physical-location-type-val-28399", + "street1": "example-street1-val-28399", + "street2": "example-street2-val-28399", + "city": "example-city-val-28399", + "state": "example-state-val-28399", + "postal-code": "example-postal-code-val-28399", + "country": "example-country-val-28399", + "region": "example-region-val-28399", + "latitude": "1111", + "longitude": "2222", + "elevation": "example-elevation-val-28399", + "lata": "example-lata-val-28399" +}
\ No newline at end of file diff --git a/local-setup/src/test/resources/create_query.json b/local-setup/src/test/resources/create_query.json new file mode 100644 index 0000000..838b802 --- /dev/null +++ b/local-setup/src/test/resources/create_query.json @@ -0,0 +1,184 @@ +{ + "named-query-uuid": "0367193e-c785-4d5f-9cb8-7bc89dc9ddb7", + "named-query-name": "get-component-list", + "named-query-version": "1.1", + "description": "Named Query - Get Component List", + "named-query-elements": { + "named-query-element": [ + { + "property-collect-list": [ + "service-instance-id", + "service-instance-name" + ], + "named-query-elements": { + "named-query-element": [ + { + "named-query-elements": { + "named-query-element": [ + { + "relationship-list": { + "relationship": [ + { + "related-to": "model", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "1b2c9ba7-e449-4831-ba15-3073672f5ef2" + } + ] + } + ] + } + } + ] + }, + "relationship-list": { + "relationship": [ + { + "related-to": "model", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "3d560d81-57d0-438b-a2a1-5334dba0651a" + } + ] + } + ] + } + }, + { + "named-query-elements": { + "named-query-element": [ + { + "relationship-list": { + "relationship": [ + { + "related-to": "model", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "fcec1b02-b2d0-4834-aef8-d71be04717dd" + } + ] + } + ] + } + }, + { + "named-query-elements": { + "named-query-element": [ + { + "relationship-list": { + "relationship": [ + { + "related-to": "model", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "ff69d4e0-a8e8-4108-bdb0-dd63217e63c7" + } + ] + } + ] + } + }, + { + "relationship-list": { + "relationship": [ + { + "related-to": "model", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "fcec1b02-b2d0-4834-aef8-d71be04717dd" + } + ] + } + ] + } + }, + { + "named-query-elements": { + "named-query-element": [ + { + "relationship-list": { + "relationship": [ + { + "related-to": "model", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "1b2c9ba7-e449-4831-ba15-3073672f5ef2" + } + ] + } + ] + } + } + ] + }, + "relationship-list": { + "relationship": [ + { + "related-to": "model", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "3d560d81-57d0-438b-a2a1-5334dba0651a" + } + ] + } + ] + } + } + ] + }, + "relationship-list": { + "relationship": [ + { + "related-to": "model", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "ef86f9c5-2165-44f3-8fc3-96018b609ea5" + } + ] + } + ] + } + } + ] + }, + "relationship-list": { + "relationship": [ + { + "related-to": "model", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "acc6edd8-a8d4-4b93-afaa-0994068be14c" + } + ] + } + ] + } + } + ] + }, + "relationship-list": { + "relationship": [ + { + "related-to": "model", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "82194af1-3c2c-485a-8f44-420e22a9eaa4" + } + ] + } + ] + } + } + ] + } +}
\ No newline at end of file diff --git a/local-setup/src/test/resources/example_model.json b/local-setup/src/test/resources/example_model.json new file mode 100644 index 0000000..b0ab619 --- /dev/null +++ b/local-setup/src/test/resources/example_model.json @@ -0,0 +1,13 @@ +{ + "model-invariant-id": "123", + "model-type": "widget", + "model-vers": { + "model-ver": [ + { + "model-version-id": "456", + "model-version": "1.0", + "model-name": "action" + } + ] + } +}
\ No newline at end of file diff --git a/local-setup/src/test/resources/execute_query.json b/local-setup/src/test/resources/execute_query.json new file mode 100644 index 0000000..6dc2462 --- /dev/null +++ b/local-setup/src/test/resources/execute_query.json @@ -0,0 +1,22 @@ +{ + "query-parameters": { + "named-query": { + "named-query-uuid": "0367193e-c785-4d5f-9cb8-7bc89dc9ddb7" + } + }, + "instance-filters": { + "instance-filter": [ + { + "service-instance": { + "service-instance-id": "37b8cdb7-94eb-468f-a0c2-4e3c3546578e" + }, + "service-subscription": { + "service-type": "vDNS" + }, + "customer": { + "global-customer-id": "aai_demo_for_onap_community" + } + } + ] + } +}
\ No newline at end of file diff --git a/local-setup/src/test/resources/models.csv b/local-setup/src/test/resources/models.csv new file mode 100644 index 0000000..4382446 --- /dev/null +++ b/local-setup/src/test/resources/models.csv @@ -0,0 +1,91 @@ +model-invariant-id,model-version-id,model-name +af593b4b-490e-4665-ad74-2f6351c0a7ce,fd7fb09e-d930-41b9-b83f-cfde9df48640,action +9551346c-7d8b-4daf-9926-b93e96e2344a,2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd,action-data +f6d6a23d-a1a9-48ff-8419-b6530da2d381,7ad0915f-25c0-4a70-b9bc-185a75f87564,allotted-resource +61b88c01-d819-41c0-8e21-7fd7ba47148e,6c092fb1-21b2-456b-9e01-67fb4de1896e,availability-zone +53dc00d4-e6d9-48ec-b6cc-3d3797e9b896,b2dea88d-78a0-49bf-95c9-5819df08e966,az-and-dvs-switches +18094b19-d16d-4822-8acf-e92c6aefa178,d2fb27cc-15eb-4c4e-828e-71d41aaecc5b,class-of-service +425b2158-e51d-4509-9945-dad4556474a3,2a160989-b202-47dd-874b-4a0f275998f7,cloud-region +af91c2f7-35fc-43cf-a13d-443f385b2353,3a8ab1ee-9220-4fe8-b89c-9251d160ddc2,complex +4c01c948-7607-4d66-8a6c-99c2c2717936,22104c9f-29fd-462f-be07-96cd6b46dd33,connector +c0292b4f-ee97-40cc-8c2e-f967c48f5701,01102126-9c04-4a89-945b-b131e61e95d7,constrained-element-set +fcb8d46b-b656-4ad6-8fa4-22cef74b443f,44e5cb1f-0938-41aa-b766-d4595109fe89,ctag-assignment +46c51d4e-d67e-4a9c-b1f5-49b1e9c6fcaa,2056c41f-23b9-4de7-9f50-819adad37d76,ctag-pool +c1d4305f-cdbd-4bbe-9069-a2f4978fd89e,d4df5c27-98a1-4812-a8aa-c17f055b7a3f,customer +245cf4b0-7cc5-4eea-bbd9-753e939adcab,c3878ffb-8d85-4114-bee6-e4074a9db10b,cvlan-tag-entry +98fbb471-1f86-428e-bd8a-c8a25de6fa23,4cb44ae8-e3ab-452a-9f95-bcc8a44c55ea,dvs-switch +7a08cad4-8759-46a5-8245-095d1ba57ac6,f0442326-8201-4d0e-857c-74b4ddcbfc9f,edge-prop-names +9a011958-7165-47a3-b872-00951d1f09ae,af27fbfd-598d-44da-aeae-0f9d3a5fcd6a,element-choice-set +ae75b5a0-d5e1-4f3a-b8fb-37626a753da3,7e27ba2e-b7db-4e13-9fae-d142152ef98a,entitlement +bace8d1c-a261-4041-9e37-823117415d0f,36200fb5-f251-4f5d-a520-7c5ad5c2cd4b,flavor +acc6edd8-a8d4-4b93-afaa-0994068be14c,93a6166f-b3d5-4f06-b4ba-aed48d009ad9,generic-vnf +7cc05f25-7ba2-42b7-a237-c5662a1689e1,fe578080-ce19-4604-8760-fc264fbb2565,group-assignment +3f4c7204-739b-4bbb-87a7-8a6856439c90,f6a038c2-820c-42ba-8c2b-375e24e8f932,image +2a2d8ad2-af0a-4e1f-9982-0c899e7dc827,f05f804d-7057-4ffe-bdc5-39f2f0c9c9fd,include-node-filter +3bf1e610-45f7-4ad6-b833-ca4c5ee6a3fd,8e6ee9dc-9017-444a-83b3-219edb018128,instance-group +cd57d844-9017-4078-aa19-926935a3d77c,69957f4a-2155-4b95-8d72-d6dd9b88b27b,inventory-item +87a383ae-cf03-432e-a9de-04e6a622d0fd,0e54bb87-bd6e-4a2b-ad1c-6d935b87ae51,inventory-item-data +aca4c310-cb45-42bd-9f88-73e40ba7b962,d949fd10-36bf-408a-ac7a-cad5004d2e0d,ipsec-configuration +f5faa464-c2f2-4cc3-89d2-a90452dc3a07,c23ea04d-1a3b-453d-bc49-a6c783a5e92b,key-data +aad85df2-09be-40fa-b867-16415e4e10e2,41e76b6f-1e06-4fd4-82cd-81c50fc4574b,l3-interface-ipv4-address-list +82966045-43ee-4982-8307-7e9610866140,d040621d-541a-477b-bb1b-a2b61b14e295,l3-interface-ipv6-address-list +3d560d81-57d0-438b-a2a1-5334dba0651a,9111f20f-e680-4001-b83f-19a2fc23bfc1,l3-network +e0ee9bde-c1fc-4651-a95d-8e0597bf7d70,ce95f7c3-b61b-4758-ae9e-7e943b1c103d,lag-interface +86ffe6e5-4d0e-4cec-80b5-5c38aa3eff98,d29a087a-af59-4053-a3f8-0f95a92faa75,lag-link +b9a9b337-1f86-42d3-b9f9-f987a089507c,6889274b-a1dc-40ab-9090-93677e13e2e6,license +9022ebfe-b54f-4911-a6b2-8c3f5ec189b7,24b25f8c-b8bd-4c62-9421-87c12667aac9,license-key-resource +cea0a982-8d55-4093-921e-418fbccf7060,a32613fd-18b9-459e-aab8-fffb3912966a,l-interface +fe012535-2c31-4a39-a739-612374c638a0,a1481a38-f8ba-4ae4-bdf1-06c2c6af4c54,logical-link +86dbb63a-265e-4614-993f-6771c30b56a5,6bae950e-8939-41d3-a6a7-251b03e4c1fc,metadatum +06d1418a-5faa-452d-a94b-a2829df5f67b,1f51c05c-b164-4c27-9c03-5cbb239fd6be,model +c28966f3-e758-4483-b37b-a90b05d3dd33,ad70dd19-f156-4fb5-a865-97b5563b0d37,model-constraint +2076e726-3577-477a-a300-7fa65cd4df11,753e813a-ba9e-4a1d-ab34-b2f6dc6eec0c,model-element +b5cd462f-e426-4146-b1fe-5475ae272c3d,93f2f8bc-cb12-4a01-96c8-3d2649e4ab8f,model-ver +ea78c9e3-514d-4a0a-9162-13837fa54c35,666a06ee-4b57-46df-bacf-908da8f10c3f,multicast-configuration +80b712fd-0ad3-4180-a99c-8c995cf1cc32,5c3b7c33-afa3-4be5-8da7-1a5ac6f99896,named-query +3c504d40-b847-424c-9d25-4fb7e0a3e994,204c641a-3494-48c8-979a-86856f5fd32a,named-query-element +6aa05779-94d7-4d8b-9bee-59ef2ab0c246,a0ccd9dc-7062-4940-9bcc-e91dd28af510,network-policy +2734b44a-b8a2-40f6-957d-6256589e5d00,01f45471-4240-498c-a9e1-235dc0b8b4a6,network-profile +4b05ec9c-c55d-4987-83ff-e08d6ddb694f,7c79e11f-a408-4593-aa86-ba948a1236af,newvce +2851cf01-9c40-4064-87d4-6184a6fcff35,f4fb34f3-fd6e-4a8f-a3fb-4ab61a343b79,oam-network +c822d81f-822f-4304-9623-1025b53da568,9c523936-95b4-4d7f-9f53-6bdfe0cf2c05,physical-link +94043c37-4e73-439c-a790-0fdd697924cd,d2cdb2d0-fc1f-4a57-a89e-591b1c4e3754,p-interface +862b25a1-262a-4961-bdaa-cdc55d69785a,e9f1fa7d-c839-418a-9601-03dc0d2ad687,pnf +8ce940fb-55d7-4230-9e7f-a56cc2741f77,03e8bb6b-b48a-46ae-b5d4-e5af577e6844,port-group +f4a863c3-6886-470a-a6ae-05723837ea45,81706bbd-981e-4362-ae20-995cbcb2d995,property-constraint +6d932c8f-463b-4e76-83fb-87acfbaa2e2d,72f0d495-bc27-4653-9e1a-eef76bd34bc9,pserver +468f6f5b-2996-41bb-b2a3-7cf9613ebb9b,0988bab5-bf4f-4938-a419-ab249867d12a,related-lookup +0c3e0ba3-618c-498d-9127-c8d42b00170f,ac49d26d-9163-430e-934a-13b738a04f5c,reserved-prop-names +ff656f23-6185-406f-9006-4b26834f3e1c,4e9b50aa-5227-4f6f-b489-62e6bbc03c79,result-data +a8614b63-2636-4c4f-98df-fd448c4241db,fed7e326-03a7-45ff-a3f2-471470d268c4,route-table-reference +1c2ded4f-8b01-4193-829c-966847dfec3e,3ccbcbc7-d19e-44d5-a52f-7e18aa8d69fa,routing-instance +738ff299-6290-4c00-8998-bd0e96a07b93,1380619d-dd1a-4cec-b755-c6407833e065,secondary-filter +6e814aee-46e1-4583-a9d4-0049bfd2b59b,c5171ae0-44fb-4c04-b482-d56702241a44,segmentation-assignment +07a3a60b-1b6c-4367-8173-8014386f89e3,ecce2c42-3957-4ae0-9442-54bc6afe27b6,service +b1a7cc05-d19d-443b-a5d1-733e325c4232,f9cfec1b-18da-4bba-bd83-4b26cca115cd,service-capability +82194af1-3c2c-485a-8f44-420e22a9eaa4,46b92144-923a-4d20-b85a-3cbd847668a9,service-instance +2e1a602a-acd8-4f78-94ff-618b802a303b,5e68299a-79f2-4bfb-8fbc-2bae877a2459,service-subscription +db63f3e6-f8d1-484e-8d5e-191600b7914b,7106bc02-6552-4fc3-8a56-4f3df9034531,site-pair +5d4dae3e-b402-4bfd-909e-ece12ff75d26,a5c6c1bc-dc38-468e-9459-bb08f87247df,site-pair-set +24de00ef-aead-4b52-995b-0adf8d4bd90d,962a7c8b-687f-4d32-a775-fe098e214bcd,snapshot +04b2935f-33c4-40a9-8af0-8b52690042dc,1e8b331f-3d4a-4160-b7aa-f4d5a8916625,sriov-vf +083093a3-e407-447a-ba5d-7583e4d23e1d,aad96fd3-e75f-42fc-9777-3450c36f1168,start-node-filter +1b2c9ba7-e449-4831-ba15-3073672f5ef2,f902a6bc-6be4-4fe5-8458-a6ec0056b374,subnet +e78a7eaa-f65d-4919-9c2b-5b258c8c4d7e,c246f6e2-e3a1-4697-94c0-5672a7fbbf04,tagged-inventory-item-list +97c26c99-6870-44c1-8a07-1d900d3f4ce6,abcc54bc-bb74-49dc-9043-7f7171707545,tenant +50b9e2fa-005c-4bbe-b651-3251dece4cd8,e7cb4ca8-e1a5-4487-a716-4ae0bcd8aef5,tunnel-xconnect +fe81c801-f65d-408a-b2b7-a729a18f8154,6004cfa6-eb6d-4062-971f-b1fde6b74aa0,update-node-key +bab6dceb-e7e6-4301-a5e0-a7399b48d792,b6cf54b5-ec45-43e1-be64-97b4e1513333,vce +ef86f9c5-2165-44f3-8fc3-96018b609ea5,c00563ae-812b-4e62-8330-7c4d0f47088a,vf-module +bed7c3b7-35d0-4cd9-abde-41b20e68b28e,8e8c22f1-fbdf-48ea-844c-8bdeb44e7b16,vig-server +5150abcf-0c5f-4593-9afe-a19c48fc4824,6dd43ced-d789-47af-a759-d3abc14e3ac1,virtual-data-center +d2b1eaf1-ae59-4116-9ee4-aa0179faa4f8,257d88a5-a269-4c35-944f-aca04fbdb791,vlan +96129eb9-f0de-4e05-8af2-73146473f766,5761e0a7-c6df-4d8a-9ebd-b8f445054dec,vnfc +f9a628ff-7aa0-40e2-a93d-02d91c950982,c4d3e747-ba4a-4b17-9896-94c6f18c19d3,vnf-image +ddd739b4-2b25-46c4-affc-41a32af5cc42,0fbe2e8f-4d91-4415-a772-88387049b38d,volume +fcec1b02-b2d0-4834-aef8-d71be04717dd,99d44c90-1f61-4418-b9a6-56586bf38c79,volume-group +053ec3a7-5b72-492d-b54d-123805a9b967,203817d3-829c-42d4-942d-2a935478e993,vpe +457ba89b-334c-4fbd-acc4-160ac0e0cdc0,b1566228-6785-4ce1-aea2-053736f80341,vpls-pe +9e23b675-db2b-488b-b459-57aa9857baa0,21a146e5-9901-448c-9197-723076770119,vpn-binding +ff69d4e0-a8e8-4108-bdb0-dd63217e63c7,8ecb2c5d-7176-4317-a255-26274edfdd53,vserver +16f7cb93-e807-4065-816b-9cdf391d4992,f7f21a66-4714-431c-af17-52d64e21de95,zone
\ No newline at end of file diff --git a/local-setup/src/test/resources/query_response.json b/local-setup/src/test/resources/query_response.json new file mode 100644 index 0000000..d68f815 --- /dev/null +++ b/local-setup/src/test/resources/query_response.json @@ -0,0 +1,48 @@ +{ + "inventory-response-item": [ + { + "model-name": "service-instance", + "service-instance": { + "service-instance-id": "37b8cdb7-94eb-468f-a0c2-4e3c3546578e", + "service-instance-name": "Demo Service Instance" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "service-instance", + "generic-vnf": { + "vnf-id": "de7cc3ab-0212-47df-9e64-da1c79234deb", + "vnf-name": "ZRDM2MMEX39", + "vnf-type": "vMME Svc Jul 14/vMME VF Jul 14 1", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "orchestration-status": "active", + "in-maint": false, + "is-closed-loop-disabled": false, + "model-invariant-id": "82194af1-3c2c-485a-8f44-420e22a9eaa4", + "model-version-id": "46b92144-923a-4d20-b85a-3cbd847668a9" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "service-instance", + "vf-module": { + "vf-module-id": "ef71d47a-53e8-40f4-a5ed-7d2cac1b20f1", + "vf-module-name": "ZRDM2MMEX39_base", + "orchestration-status": "pending-create", + "is-base-vf-module": true, + "automated-assignment": false, + "model-invariant-id": "82194af1-3c2c-485a-8f44-420e22a9eaa4", + "model-version-id": "46b92144-923a-4d20-b85a-3cbd847668a9" + }, + "extra-properties": {} + } + ] + } + } + ] + } + } + ] +}
\ No newline at end of file |