summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.readthedocs.yaml23
-rw-r--r--aai-aaf-auth/src/main/java/org/onap/aai/aaf/auth/AAIAuthCore.java17
-rw-r--r--aai-aaf-auth/src/main/java/org/onap/aai/aaf/auth/AafRequestFilter.java2
-rw-r--r--aai-common-docker/aai-haproxy-image/src/main/docker/Dockerfile19
-rw-r--r--aai-common-docker/aai-haproxy-image/src/main/docker/docker-entrypoint.sh8
-rw-r--r--aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java2
-rw-r--r--aai-core/src/main/java/org/onap/aai/extensions/ExtensionController.java7
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/Introspector.java15
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java13
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java19
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/sideeffect/PrivateEdge.java8
-rw-r--r--aai-core/src/main/java/org/onap/aai/prevalidation/ValidationService.java4
-rw-r--r--aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java13
-rw-r--r--aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java2
-rw-r--r--aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java2
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java12
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java19
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java5
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/HistoryFormat.java12
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/IdURL.java5
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/PathedURL.java5
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/RawFormat.java2
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/Resource.java8
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/ResourceWithSoT.java2
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/SimpleFormat.java5
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/TreeFormat.java18
-rw-r--r--aai-core/src/main/java/org/onap/aai/util/RestController.java12
-rw-r--r--aai-core/src/main/java/org/onap/aai/util/RestControllerInterface.java5
-rw-r--r--aai-core/src/test/java/org/onap/aai/HttpTestUtil.java24
-rw-r--r--aai-core/src/test/java/org/onap/aai/PayloadUtil.java7
-rw-r--r--aai-core/src/test/java/org/onap/aai/prevalidation/ValidationServiceTest.java2
-rw-r--r--aai-core/src/test/java/org/onap/aai/rest/NotificationDmaapEventTest.java42
-rw-r--r--aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java26
-rw-r--r--aai-core/src/test/java/org/onap/aai/restcore/RESTAPITest.java8
-rw-r--r--aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java26
-rw-r--r--aai-core/src/test/java/org/onap/aai/serialization/db/ImpliedDeleteUnitTest.java4
-rw-r--r--aai-core/src/test/java/org/onap/aai/serialization/queryformats/MultiFormatTest.java12
-rw-r--r--aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java6
-rw-r--r--aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java6
-rw-r--r--aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/UrlBuilderTest.java2
-rw-r--r--aai-els-onap-logging/src/main/java/org/onap/aai/logging/LoggingContext.java2
-rw-r--r--aai-els-onap-logging/src/test/java/org/onap/aai/logging/ErrorObjectTest.java2
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/PropertyPasswordConfiguration.java3
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java21
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java4
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockRestClient.java19
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/restclient/SchemaRestClientTest.java2
-rw-r--r--docs/AAI REST API Documentation/AAIRESTAPI.rst121
-rw-r--r--docs/AAI REST API Documentation/AAIRESTAPI_AMSTERDAM.rst607
-rw-r--r--docs/AAI REST API Documentation/AAIRESTAPI_CASABLANCA.rst1727
-rw-r--r--docs/AAI REST API Documentation/AAIRESTAPI_DUBLIN.rst1777
-rw-r--r--docs/AAI REST API Documentation/nodesApi.rst51
-rw-r--r--docs/AAI REST API Documentation/nodesQuery.rst18
-rw-r--r--docs/AAI REST API Documentation/recentsApi.rst6
-rw-r--r--docs/_static/css/ribbon.css2
-rw-r--r--docs/conf.py53
-rw-r--r--docs/index.rst6
-rw-r--r--docs/platform/Getting Started/AAI_Developer_Environment_Setup.rst36
-rw-r--r--docs/platform/Getting Started/Queries/vnf_to_esr_system_info_Named_Query.rst2
-rw-r--r--docs/release-notes.rst11
-rw-r--r--docs/requirements-docs.txt6
-rw-r--r--docs/tox.ini31
62 files changed, 479 insertions, 4457 deletions
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
index 3797dc8b..cedcf757 100644
--- a/.readthedocs.yaml
+++ b/.readthedocs.yaml
@@ -1,20 +1,21 @@
---
# .readthedocs.yml
-# Read the Docs configuration file
-# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
-# Required
+# # Read the Docs configuration file
+# # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+# # Required
+#
version: 2
-formats:
- - htmlzip
-
build:
- image: latest
+ image: latest
python:
- version: 3.7
- install:
- - requirements: docs/requirements-docs.txt
+ version: 3.7
+ install:
+ - requirements: docs/requirements-docs.txt
+
+submodules:
+ include: all
sphinx:
- configuration: docs/conf.py
+ configuration: docs/conf.py
diff --git a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/auth/AAIAuthCore.java b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/auth/AAIAuthCore.java
index f591125c..72e2295e 100644
--- a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/auth/AAIAuthCore.java
+++ b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/auth/AAIAuthCore.java
@@ -31,7 +31,19 @@ import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.nio.file.Files;
import java.nio.file.Paths;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -144,8 +156,7 @@ public final class AAIAuthCore {
LOGGER.debug("Reading from " + globalAuthFileName);
String authFile = new String(Files.readAllBytes(Paths.get(globalAuthFileName)));
- JsonParser parser = new JsonParser();
- JsonObject authObject = parser.parse(authFile).getAsJsonObject();
+ JsonObject authObject = JsonParser.parseString(authFile).getAsJsonObject();
if (authObject.has("roles")) {
JsonArray roles = authObject.getAsJsonArray("roles");
for (JsonElement role : roles) {
diff --git a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/auth/AafRequestFilter.java b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/auth/AafRequestFilter.java
index cfaa61be..2c8aaf28 100644
--- a/aai-aaf-auth/src/main/java/org/onap/aai/aaf/auth/AafRequestFilter.java
+++ b/aai-aaf-auth/src/main/java/org/onap/aai/aaf/auth/AafRequestFilter.java
@@ -99,7 +99,7 @@ public class AafRequestFilter {
return;
}
issuer = issuer.replaceAll("\\s+", "").toUpperCase();
- Enumeration hdrs = request.getHeaders(CertUtil.AAF_USER_CHAIN_HDR);
+ Enumeration<String> hdrs = request.getHeaders(CertUtil.AAF_USER_CHAIN_HDR);
while (hdrs.hasMoreElements()) {
String headerValue = (String) hdrs.nextElement();
LOGGER.debug("authorizationFilter user chain headerValue=" + headerValue);
diff --git a/aai-common-docker/aai-haproxy-image/src/main/docker/Dockerfile b/aai-common-docker/aai-haproxy-image/src/main/docker/Dockerfile
index 3e04c92c..1508abca 100644
--- a/aai-common-docker/aai-haproxy-image/src/main/docker/Dockerfile
+++ b/aai-common-docker/aai-haproxy-image/src/main/docker/Dockerfile
@@ -1,4 +1,4 @@
-FROM haproxy:1.7.10-alpine
+FROM haproxy:2.4.13-alpine
# For building the image in a proxy environment if necessary
ARG HTTP_PROXY
@@ -9,14 +9,17 @@ ENV HTTPS_PROXY ${HTTPS_PROXY}
ENV http_proxy ${HTTP_PROXY}
ENV https_proxy ${HTTPS_PROXY}
+# Added to execute commands which required root permission
+USER root
+
RUN apk add --no-cache \
ca-certificates \
curl \
+ bash \
+ socat \
openssl \
shadow \
util-linux && \
- groupadd haproxy -g 1000 && \
- adduser -u 1000 -S -D -G haproxy -s /bin/bash haproxy && \
chown -R haproxy:haproxy /usr/local/etc/haproxy
RUN mkdir -p /etc/ssl/certs/ && mkdir -p /etc/ssl/private
@@ -26,7 +29,15 @@ COPY --chown=haproxy docker-entrypoint.sh /docker-entrypoint.sh
COPY --chown=haproxy resolvers.conf /usr/local/etc/haproxy/resolvers.conf
COPY --chown=haproxy haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
-RUN chmod +x /docker-entrypoint.sh
+# Changing group and group permission to allow haproxy user to execute sed comamnd ot change files
+RUN chgrp haproxy /usr/local/etc/haproxy; \
+ chgrp haproxy /docker-entrypoint.sh /usr/local/etc/haproxy/haproxy.cfg /usr/local/etc/haproxy/resolvers.conf
+
+RUN chmod +x /docker-entrypoint.sh; \
+ chmod g+wx /usr/local/etc/haproxy; \
+ chmod g+w /docker-entrypoint.sh /usr/local/etc/haproxy/haproxy.cfg /usr/local/etc/haproxy/resolvers.conf
+
+# Reverting to haproxy use to not run the pod with root permissions
USER haproxy
ENTRYPOINT [ "/docker-entrypoint.sh" ]
diff --git a/aai-common-docker/aai-haproxy-image/src/main/docker/docker-entrypoint.sh b/aai-common-docker/aai-haproxy-image/src/main/docker/docker-entrypoint.sh
index a56eea95..a8e521f1 100644
--- a/aai-common-docker/aai-haproxy-image/src/main/docker/docker-entrypoint.sh
+++ b/aai-common-docker/aai-haproxy-image/src/main/docker/docker-entrypoint.sh
@@ -14,9 +14,11 @@ sed -i 's/${ONAP_NAMESERVER_CLUSTER_IP}/'${NAMESERVER_IP}'/g' /usr/local/etc/hap
}
if [ "$1" = 'haproxy' ]; then
- # if the user wants "haproxy", let's use "haproxy-systemd-wrapper" instead so we can have proper reloadability implemented by upstream
- shift # "haproxy"
- set -- "$(which haproxy-systemd-wrapper)" -p /usr/local/etc/haproxy/haproxy.pid "$@"
+ shift # "haproxy"
+ # if the user wants "haproxy", let's add a couple useful flags
+ # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2")
+ # -db -- disables background mode
+ set -- haproxy -W -db "$@"
fi
exec "$@"
diff --git a/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java b/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java
index 2858ece3..d3addebb 100644
--- a/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java
+++ b/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java
@@ -119,7 +119,7 @@ public class AAIDmaapEventJMSConsumer implements MessageListener {
}
metricLog.pre(eventName, aaiEvent, transactionId, serviceName);
- HttpEntity httpEntity = new HttpEntity(aaiEvent, httpHeaders);
+ HttpEntity<String> httpEntity = new HttpEntity<String>(aaiEvent, httpHeaders);
String transportType = environment.getProperty("dmaap.ribbon.transportType", "http");
String baseUrl = transportType + "://" + environment.getProperty("dmaap.ribbon.listOfServers");
diff --git a/aai-core/src/main/java/org/onap/aai/extensions/ExtensionController.java b/aai-core/src/main/java/org/onap/aai/extensions/ExtensionController.java
index 612273d4..01e42f3d 100644
--- a/aai-core/src/main/java/org/onap/aai/extensions/ExtensionController.java
+++ b/aai-core/src/main/java/org/onap/aai/extensions/ExtensionController.java
@@ -63,7 +63,7 @@ public class ExtensionController {
Method extension = clazz.getMethod(methodName, new Class[] {AAIExtensionMap.class});
if (extension != null) {
- Object ret = extension.invoke(clazz.newInstance(), aaiExtMap);
+ Object ret = extension.invoke(clazz.getDeclaredConstructor().newInstance(), aaiExtMap);
if (ret instanceof Integer) {
Exception e = null;
@@ -101,11 +101,12 @@ public class ExtensionController {
}
if (errorCallback != null) {
- errorCallback.invoke(clazz.newInstance(), aaiExtMap);
+ errorCallback.invoke(clazz.getDeclaredConstructor().newInstance(), aaiExtMap);
} else {
Method defaultErrorCallbackExtension =
clazz.getMethod(defaultErrorCallback, new Class[] {AAIExtensionMap.class});
- defaultErrorCallbackExtension.invoke(clazz.newInstance(), aaiExtMap);
+ defaultErrorCallbackExtension.invoke(clazz.getDeclaredConstructor().newInstance(),
+ aaiExtMap);
}
}
}
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java b/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java
index c9e1f455..87983d8d 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java
@@ -103,9 +103,10 @@ public abstract class Introspector implements Cloneable {
Class<?> clazz = this.getClass(name);
if (this.isListType(name) && result == null) {
try {
- this.set(convertedName, clazz.newInstance());
+ this.set(convertedName, clazz.getDeclaredConstructor().newInstance());
result = this.get(convertedName);
- } catch (DynamicException | InstantiationException | IllegalAccessException e) {
+ } catch (DynamicException | InstantiationException | IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException | NoSuchMethodException | SecurityException e) {
LOGGER.warn(e.getMessage(), e);
}
}
@@ -127,9 +128,10 @@ public abstract class Introspector implements Cloneable {
Class<?> clazz = this.getClass(name);
if (this.isListType(name) && value == null) {
try {
- this.set(convertedName, clazz.newInstance());
+ this.set(convertedName, clazz.getDeclaredConstructor().newInstance());
value = this.get(convertedName);
- } catch (DynamicException | InstantiationException | IllegalAccessException e) {
+ } catch (DynamicException | InstantiationException | IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException | NoSuchMethodException | SecurityException e) {
LOGGER.warn(e.getMessage(), e);
}
}
@@ -159,9 +161,10 @@ public abstract class Introspector implements Cloneable {
Class<?> clazz = this.getClass(name);
if (isListType && value == null) {
try {
- this.set(convertedName, clazz.newInstance());
+ this.set(convertedName, clazz.getDeclaredConstructor().newInstance());
value = this.get(convertedName);
- } catch (DynamicException | InstantiationException | IllegalAccessException e) {
+ } catch (DynamicException | InstantiationException | IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException | NoSuchMethodException | SecurityException e) {
LOGGER.warn(e.getMessage(), e);
}
}
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java b/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
index 40352360..496c1e82 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
@@ -21,6 +21,7 @@
package org.onap.aai.introspection;
import java.io.UnsupportedEncodingException;
+import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -150,7 +151,7 @@ public class JSONStrategy extends Introspector {
Class<?> resultClass = null;
Object resultObject = this.getValue(name);
if (resultObject instanceof JSONArray) {
- resultClass = ((List) resultObject).get(0).getClass();
+ resultClass = ((List<?>) resultObject).get(0).getClass();
}
return resultClass;
@@ -159,8 +160,9 @@ public class JSONStrategy extends Introspector {
@Override
public Object newInstanceOfProperty(String name) {
try {
- return this.getClass(name).newInstance();
- } catch (InstantiationException | IllegalAccessException e) {
+ return this.getClass(name).getDeclaredConstructor().newInstance();
+ } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
+ | NoSuchMethodException | SecurityException e) {
return null;
}
}
@@ -168,8 +170,9 @@ public class JSONStrategy extends Introspector {
@Override
public Object newInstanceOfNestedProperty(String name) {
try {
- return this.getGenericTypeClass(name).newInstance();
- } catch (InstantiationException | IllegalAccessException e) {
+ return this.getGenericTypeClass(name).getDeclaredConstructor().newInstance();
+ } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
+ | NoSuchMethodException | SecurityException e) {
return null;
}
}
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java b/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java
index df8e9238..55980c3b 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java
@@ -25,8 +25,15 @@ import com.google.common.base.Joiner;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.Set;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
@@ -170,12 +177,12 @@ public class MoxyStrategy extends Introspector {
DatabaseMapping mapping = cd.getMappingForAttributeName(propName);
Map<PropertyMetadata, String> result = new HashMap<>();
if (mapping != null) {
- Set<Entry> entrySet = mapping.getProperties().entrySet();
- for (Entry<?, ?> entry : entrySet) {
+ Set<Map.Entry<String, String>> entrySet = mapping.getProperties().entrySet();
+ for (Entry<String, String> entry : entrySet) {
result.put(
- PropertyMetadata.valueOf(
- CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, (String) entry.getKey())),
- (String) entry.getValue());
+ PropertyMetadata
+ .valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, entry.getKey())),
+ entry.getValue());
}
}
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/PrivateEdge.java b/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/PrivateEdge.java
index 9e32ef40..e58ff9bc 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/PrivateEdge.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/PrivateEdge.java
@@ -25,8 +25,12 @@ import com.google.common.collect.Multimap;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.Optional;
import javax.ws.rs.core.MultivaluedMap;
@@ -92,7 +96,7 @@ public class PrivateEdge extends SideEffect {
List<Vertex> results = uriQuery.getQueryBuilder().toList();
if (results.size() == 1) {
Vertex otherVertex = results.get(0);
- VertexProperty otherVProperty = otherVertex.property("aai-node-type");
+ VertexProperty<Object> otherVProperty = otherVertex.property("aai-node-type");
if (otherVProperty.isPresent()) {
diff --git a/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationService.java b/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationService.java
index c66511f0..70e16e27 100644
--- a/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationService.java
+++ b/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationService.java
@@ -222,7 +222,7 @@ public class ValidationService {
httpHeaders.put("Content-Type", "application/json");
List<String> violations = new ArrayList<>();
- ResponseEntity responseEntity;
+ ResponseEntity<String> responseEntity;
try {
responseEntity = validationRestClient.execute(VALIDATION_ENDPOINT, HttpMethod.POST, httpHeaders, body);
@@ -267,7 +267,7 @@ public class ValidationService {
return violations;
}
- boolean isSuccess(ResponseEntity responseEntity) {
+ boolean isSuccess(ResponseEntity<String> responseEntity) {
return responseEntity != null && responseEntity.getStatusCode().is2xxSuccessful();
}
diff --git a/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java b/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java
index 2517e2c0..3c5c4489 100644
--- a/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java
+++ b/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java
@@ -23,7 +23,12 @@ package org.onap.aai.query.builder;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.Path;
@@ -288,7 +293,7 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> {
if (val != null) {
// this is because the index is registered as an Integer
if (val.getClass().equals(Long.class)) {
- this.vertexHas(key, new Integer(val.toString()));
+ this.vertexHas(key, Integer.valueOf(val.toString()));
} else {
this.vertexHas(key, val);
}
@@ -321,7 +326,7 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> {
}
// this is because the index is registered as an Integer
if (val.getClass().equals(Long.class)) {
- this.vertexHas(prop, new Integer(val.toString()));
+ this.vertexHas(prop, Integer.valueOf(val.toString()));
} else {
this.vertexHas(prop, val);
}
@@ -904,7 +909,7 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> {
protected void executeQuery() {
- Admin admin;
+ Admin<Vertex, Vertex> admin;
if (start != null) {
this.completeTraversal = traversal.asAdmin();
} else {
diff --git a/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java b/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java
index 423583f4..2bc90726 100644
--- a/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java
+++ b/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java
@@ -634,7 +634,7 @@ public abstract class QueryBuilder<E> implements Iterator<E> {
protected Object correctObjectType(Object obj) {
if (obj != null && obj.getClass().equals(Long.class)) {
- return new Integer(obj.toString());
+ return Integer.valueOf(obj.toString());
}
return obj;
diff --git a/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java b/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java
index 3666eb67..31805fd4 100644
--- a/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java
+++ b/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java
@@ -341,7 +341,7 @@ public class RESTAPI {
* @return the response
*/
public Response runner(String toe, String tba, String tdl, HttpHeaders headers, UriInfo info, HttpMethod httpMethod,
- Callable c) {
+ Callable<Response> c) {
Response response = null;
Future<Response> handler = null;
ExecutorService executor = null;
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java b/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
index dc478337..2192ff5e 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
@@ -575,7 +575,7 @@ public class DBSerializer {
if (value != null) {
if (!value.equals(oldValue)) {
if (propertyType.toLowerCase().contains(".long")) {
- v.property(dbProperty, new Integer(((Long) value).toString()));
+ v.property(dbProperty, Integer.valueOf(((Long) value).toString()));
} else {
v.property(dbProperty, value);
}
@@ -723,7 +723,7 @@ public class DBSerializer {
throws IllegalArgumentException, SecurityException, UnsupportedEncodingException, AAIException {
HashMap<String, Introspector> relatedVertices = new HashMap<>();
- VertexProperty aaiUriProperty = v.property(AAIProperties.AAI_URI);
+ VertexProperty<Object> aaiUriProperty = v.property(AAIProperties.AAI_URI);
if (!aaiUriProperty.isPresent()) {
if (LOGGER.isDebugEnabled()) {
@@ -1232,7 +1232,7 @@ public class DBSerializer {
throw new AAIException("AAI_6136",
"query object mismatch: this object cannot hold multiple items." + obj.getDbName());
} else if (obj.isContainer()) {
- final List getList;
+ final List<Object> getList;
String listProperty = null;
for (String property : obj.getProperties()) {
if (obj.isListType(property) && obj.isComplexGenericType(property)) {
@@ -1565,7 +1565,7 @@ public class DBSerializer {
throws UnsupportedEncodingException, AAIException {
List<Object> relationshipObjList = obj.getValue(RELATIONSHIP);
- VertexProperty nodeTypeProperty = v.property(AAIProperties.NODE_TYPE);
+ VertexProperty<Object> nodeTypeProperty = v.property(AAIProperties.NODE_TYPE);
if (!nodeTypeProperty.isPresent()) {
LOGGER.warn("Not processing the vertex {} because its missing required property aai-node-type", v.id());
@@ -1651,7 +1651,7 @@ public class DBSerializer {
private Object processEdgeRelationship(Introspector relationshipObj, Vertex cousin, String cleanUp,
String edgeLabel, boolean isSkipRelatedTo) throws UnsupportedEncodingException, AAIUnknownObjectException {
- VertexProperty aaiUriProperty = cousin.property("aai-uri");
+ VertexProperty<Object> aaiUriProperty = cousin.property("aai-uri");
if (!aaiUriProperty.isPresent()) {
return null;
@@ -1670,7 +1670,7 @@ public class DBSerializer {
return null;
}
- VertexProperty cousinVertexNodeType = cousin.property(AAIProperties.NODE_TYPE);
+ VertexProperty<Object> cousinVertexNodeType = cousin.property(AAIProperties.NODE_TYPE);
if (cousinVertexNodeType.isPresent()) {
String cousinType = cousinVertexNodeType.value().toString();
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java
index 28362826..71f7bc78 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java
@@ -20,10 +20,19 @@
package org.onap.aai.serialization.queryformats;
-import com.google.gson.*;
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
import java.io.UnsupportedEncodingException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -47,7 +56,6 @@ import org.slf4j.LoggerFactory;
public class Aggregate extends MultiFormatMapper {
private static final Logger LOGGER = LoggerFactory.getLogger(LifecycleFormat.class);
- protected JsonParser parser = new JsonParser();
protected final DBSerializer serializer;
protected final Loader loader;
protected final UrlBuilder urlBuilder;
@@ -99,7 +107,7 @@ public class Aggregate extends MultiFormatMapper {
}
final String json = obj.marshal(false);
- return Optional.of(parser.parse(json).getAsJsonObject());
+ return Optional.of(JsonParser.parseString(json).getAsJsonObject());
} catch (AAIUnknownObjectException e) {
return Optional.empty();
}
@@ -194,7 +202,8 @@ public class Aggregate extends MultiFormatMapper {
return Optional.of(json);
}
- private Optional<JsonArray> processInput(Object input, Map properties) throws AAIFormatVertexException {
+ private Optional<JsonArray> processInput(Object input, Map<String, List<String>> properties)
+ throws AAIFormatVertexException {
JsonArray json = new JsonArray();
for (Object l : (ArrayList) input) {
if (l instanceof ArrayList) {
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java
index fc3316d4..c0ba860f 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java
@@ -50,7 +50,6 @@ public class GraphSON implements FormatMapper {
private final GraphSONMapper mapper =
GraphSONMapper.build().addRegistry(JanusGraphIoRegistry.getInstance()).create();
private final GraphSONWriter writer = GraphSONWriter.build().mapper(mapper).create();
- protected JsonParser parser = new JsonParser();
@Override
public Optional<JsonObject> formatObject(Object v) {
@@ -64,7 +63,7 @@ public class GraphSON implements FormatMapper {
logger.debug("GraphSON writeVertex error : {}", e.getMessage());
}
- JsonObject jsonObject = parser.parse(result).getAsJsonObject();
+ JsonObject jsonObject = JsonParser.parseString(result).getAsJsonObject();
if (jsonObject != null) {
@@ -105,7 +104,7 @@ public class GraphSON implements FormatMapper {
*/
private void removePrivateEdges(JsonObject jsonObject, JsonObject edges, String edgeDirection) {
- Iterator it = edges.entrySet().iterator();
+ Iterator<Map.Entry<String, JsonElement>> it = edges.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, JsonElement> outEntry = (Map.Entry<String, JsonElement>) it.next();
JsonArray edgePropertiesArray = outEntry.getValue().getAsJsonArray();
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/HistoryFormat.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/HistoryFormat.java
index fccc17c6..02c4041f 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/HistoryFormat.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/HistoryFormat.java
@@ -23,7 +23,6 @@ package org.onap.aai.serialization.queryformats;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import java.util.Iterator;
import java.util.List;
@@ -31,7 +30,11 @@ import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.apache.tinkerpop.gremlin.structure.*;
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.onap.aai.db.props.AAIProperties;
import org.onap.aai.introspection.Loader;
import org.onap.aai.serialization.db.DBSerializer;
@@ -61,7 +64,6 @@ public abstract class HistoryFormat extends MultiFormatMapper {
protected static final String RELATED_TO = "related-to";
protected static final String NODE_ACTIONS = "node-actions";
- protected JsonParser parser = new JsonParser();
protected final DBSerializer serializer;
protected final Loader loader;
protected final UrlBuilder urlBuilder;
@@ -90,10 +92,10 @@ public abstract class HistoryFormat extends MultiFormatMapper {
protected JsonObject createMetaPropertiesObject(VertexProperty<Object> prop) {
JsonObject json = new JsonObject();
- Iterator iter = prop.properties();
+ Iterator<Property<Object>> iter = prop.properties();
while (iter.hasNext()) {
- Property<Object> metaProp = (Property) iter.next();
+ Property<Object> metaProp = iter.next();
mapPropertyValues(json, metaProp.key(), metaProp.value());
}
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/IdURL.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/IdURL.java
index 10bba7f6..b9ba00eb 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/IdURL.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/IdURL.java
@@ -45,18 +45,15 @@ import org.onap.aai.serialization.queryformats.utils.UrlBuilder;
public class IdURL extends MultiFormatMapper {
private final UrlBuilder urlBuilder;
- private final JsonParser parser;
private final Loader loader;
public IdURL(Loader loader, UrlBuilder urlBuilder) throws AAIException {
this.urlBuilder = urlBuilder;
- this.parser = new JsonParser();
this.loader = loader;
}
public IdURL(Builder builder) throws AAIException {
this.urlBuilder = builder.getUrlBuilder();
- this.parser = new JsonParser();
this.loader = builder.getLoader();
this.isTree = builder.isTree();
}
@@ -77,7 +74,7 @@ public class IdURL extends MultiFormatMapper {
final String json = searchResult.marshal(false);
- return Optional.of(parser.parse(json).getAsJsonObject());
+ return Optional.of(JsonParser.parseString(json).getAsJsonObject());
} catch (AAIUnknownObjectException e) {
throw new RuntimeException("Fatal error - result-data object does not exist!");
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/PathedURL.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/PathedURL.java
index f052f778..0331925c 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/PathedURL.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/PathedURL.java
@@ -45,19 +45,16 @@ import org.onap.aai.serialization.queryformats.utils.UrlBuilder;
public final class PathedURL extends MultiFormatMapper {
private final UrlBuilder urlBuilder;
- private final JsonParser parser;
private final Loader loader;
private boolean includeUrl = false;
public PathedURL(Loader loader, UrlBuilder urlBuilder) throws AAIException {
this.urlBuilder = urlBuilder;
- this.parser = new JsonParser();
this.loader = loader;
}
public PathedURL(Builder builder) {
this.urlBuilder = builder.getUrlBuilder();
- this.parser = new JsonParser();
this.loader = builder.getLoader();
this.isTree = builder.isTree();
this.includeUrl = builder.isIncludeUrl();
@@ -82,7 +79,7 @@ public final class PathedURL extends MultiFormatMapper {
searchResult.setValue("resource-version", v.value(AAIProperties.RESOURCE_VERSION));
final String json = searchResult.marshal(false);
- return Optional.of(this.parser.parse(json).getAsJsonObject());
+ return Optional.of(JsonParser.parseString(json).getAsJsonObject());
} catch (AAIUnknownObjectException e) {
throw new RuntimeException("Fatal error - result-data does not exist!", e);
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/RawFormat.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/RawFormat.java
index bd858f4b..fe47a579 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/RawFormat.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/RawFormat.java
@@ -23,7 +23,6 @@ package org.onap.aai.serialization.queryformats;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import java.util.Collections;
import java.util.Iterator;
@@ -47,7 +46,6 @@ import org.onap.aai.serialization.queryformats.params.NodesOnly;
import org.onap.aai.serialization.queryformats.utils.UrlBuilder;
public class RawFormat extends MultiFormatMapper {
- protected JsonParser parser = new JsonParser();
protected final DBSerializer serializer;
protected final Loader loader;
protected final UrlBuilder urlBuilder;
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Resource.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Resource.java
index f4fd921f..1a69bed3 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Resource.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Resource.java
@@ -56,7 +56,6 @@ public class Resource extends MultiFormatMapper {
private final Loader loader;
private final DBSerializer serializer;
- private final JsonParser parser;
private final UrlBuilder urlBuilder;
private final boolean includeUrl;
private final boolean nodesOnly;
@@ -64,7 +63,6 @@ public class Resource extends MultiFormatMapper {
private final boolean isSkipRelatedTo;
public Resource(Builder builder) {
- this.parser = new JsonParser();
this.loader = builder.getLoader();
this.serializer = builder.getSerializer();
this.urlBuilder = builder.getUrlBuilder();
@@ -190,7 +188,7 @@ public class Resource extends MultiFormatMapper {
final String json = obj.marshal(false);
- return Optional.of(getParser().parse(json).getAsJsonObject());
+ return Optional.of(JsonParser.parseString(json).getAsJsonObject());
} catch (AAIUnknownObjectException e) {
return Optional.empty();
}
@@ -209,10 +207,6 @@ public class Resource extends MultiFormatMapper {
return serializer;
}
- private JsonParser getParser() {
- return parser;
- }
-
public static class Builder implements NodesOnly<Builder>, Depth<Builder>, AsTree<Builder> {
private final Loader loader;
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/ResourceWithSoT.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/ResourceWithSoT.java
index 076f665d..e81f6037 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/ResourceWithSoT.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/ResourceWithSoT.java
@@ -21,7 +21,6 @@
package org.onap.aai.serialization.queryformats;
import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import java.util.List;
import java.util.Map;
@@ -39,7 +38,6 @@ import org.onap.aai.serialization.queryformats.utils.UrlBuilder;
import org.onap.aai.util.AAIConfig;
public class ResourceWithSoT extends MultiFormatMapper {
- protected JsonParser parser = new JsonParser();
protected final DBSerializer serializer;
protected final Loader loader;
protected final UrlBuilder urlBuilder;
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/SimpleFormat.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/SimpleFormat.java
index f1d1c26e..1caa7b50 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/SimpleFormat.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/SimpleFormat.java
@@ -22,6 +22,7 @@ package org.onap.aai.serialization.queryformats;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
@@ -67,7 +68,7 @@ public class SimpleFormat extends RawFormat {
}
final String json = obj.marshal(false);
- return Optional.of(parser.parse(json).getAsJsonObject());
+ return Optional.of(JsonParser.parseString(json).getAsJsonObject());
} catch (AAIUnknownObjectException e) {
return Optional.empty();
}
@@ -77,7 +78,7 @@ public class SimpleFormat extends RawFormat {
@Override
protected void addEdge(Edge e, Vertex v, JsonArray array) throws AAIFormatVertexException {
- Property property = e.property("private");
+ Property<Object> property = e.property("private");
if (property.isPresent()) {
if ("true".equals(e.property("private").value().toString())) {
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/TreeFormat.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/TreeFormat.java
index 2e1cbf6e..0da0ec55 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/TreeFormat.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/TreeFormat.java
@@ -28,8 +28,11 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.UnsupportedEncodingException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.Optional;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
@@ -49,7 +52,6 @@ import org.onap.aai.serialization.queryformats.utils.UrlBuilder;
public class TreeFormat extends MultiFormatMapper {
private static final EELFLogger TREE_FORMAT_LOGGER = EELFManager.getInstance().getLogger(TreeFormat.class);
- protected JsonParser parser = new JsonParser();
protected final DBSerializer serializer;
protected final Loader loader;
protected final UrlBuilder urlBuilder;
@@ -181,9 +183,9 @@ public class TreeFormat extends MultiFormatMapper {
// DSL Query
if (o instanceof BulkSet) {
- BulkSet bs = (BulkSet) o;
- for (Object o1 : bs) {
- Optional<JsonObject> obj = this.getJsonFromVertex((Vertex) o1);
+ BulkSet<Vertex> bs = (BulkSet<Vertex>) o;
+ for (Vertex o1 : bs) {
+ Optional<JsonObject> obj = this.getJsonFromVertex(o1);
if (obj.isPresent()) {
jsonObject = obj.get();
for (Map.Entry<String, JsonElement> mapEntry : jsonObject.entrySet()) {
@@ -312,7 +314,7 @@ public class TreeFormat extends MultiFormatMapper {
final String json = obj.marshal(false);
- return Optional.of(getParser().parse(json).getAsJsonObject());
+ return Optional.of(JsonParser.parseString(json).getAsJsonObject());
} catch (AAIUnknownObjectException e) {
return Optional.empty();
}
@@ -326,10 +328,6 @@ public class TreeFormat extends MultiFormatMapper {
return serializer;
}
- private JsonParser getParser() {
- return parser;
- }
-
@Override
protected Optional<JsonObject> getJsonFromVertex(Vertex input, Map<String, List<String>> properties)
throws AAIFormatVertexException {
diff --git a/aai-core/src/main/java/org/onap/aai/util/RestController.java b/aai-core/src/main/java/org/onap/aai/util/RestController.java
index 6c57040d..1b050829 100644
--- a/aai-core/src/main/java/org/onap/aai/util/RestController.java
+++ b/aai-core/src/main/java/org/onap/aai/util/RestController.java
@@ -27,6 +27,7 @@ import com.sun.jersey.api.client.ClientHandlerException;
import com.sun.jersey.api.client.ClientResponse;
import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
@@ -256,7 +257,7 @@ public class RestController implements RestControllerInterface {
* @return the list
* @throws Exception the exception
*/
- private <T> List<T> mapJsonToObjectList(T typeDef, String json, Class clazz) throws Exception {
+ private <T> List<T> mapJsonToObjectList(T typeDef, String json, Class<?> clazz) throws Exception {
List<T> list;
ObjectMapper mapper = new ObjectMapper();
System.out.println(json);
@@ -480,9 +481,14 @@ public class RestController implements RestControllerInterface {
* @return single instance of RestController
* @throws IllegalAccessException the illegal access exception
* @throws InstantiationException the instantiation exception
+ * @throws SecurityException
+ * @throws NoSuchMethodException
+ * @throws InvocationTargetException
+ * @throws IllegalArgumentException
*/
- public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException {
- return clazz.newInstance();
+ public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException,
+ IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
+ return clazz.getDeclaredConstructor().newInstance();
}
/**
diff --git a/aai-core/src/main/java/org/onap/aai/util/RestControllerInterface.java b/aai-core/src/main/java/org/onap/aai/util/RestControllerInterface.java
index 3304e9a5..6d20a010 100644
--- a/aai-core/src/main/java/org/onap/aai/util/RestControllerInterface.java
+++ b/aai-core/src/main/java/org/onap/aai/util/RestControllerInterface.java
@@ -20,6 +20,8 @@
package org.onap.aai.util;
+import java.lang.reflect.InvocationTargetException;
+
import org.onap.aai.exceptions.AAIException;
public interface RestControllerInterface {
@@ -38,7 +40,8 @@ public interface RestControllerInterface {
public void Delete(String sourceID, String transId, String path) throws AAIException;
- public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException;
+ public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException,
+ IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException;
public <T> T DoesResourceExist(String resourcePath, String resourceClassName, String fromAppId, String transId);
}
diff --git a/aai-core/src/test/java/org/onap/aai/HttpTestUtil.java b/aai-core/src/test/java/org/onap/aai/HttpTestUtil.java
index 9d406eb2..07764ecc 100644
--- a/aai-core/src/test/java/org/onap/aai/HttpTestUtil.java
+++ b/aai-core/src/test/java/org/onap/aai/HttpTestUtil.java
@@ -20,14 +20,26 @@
package org.onap.aai;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.*;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.when;
import java.io.UnsupportedEncodingException;
import java.net.URI;
-import java.util.*;
-
-import javax.ws.rs.core.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.UriInfo;
import org.javatuples.Pair;
import org.mockito.Mockito;
@@ -139,7 +151,7 @@ public class HttpTestUtil extends RESTAPI {
when(uriInfo.getQueryParameters()).thenReturn(queryParameters);
when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters);
- doReturn(null).when(queryParameters).remove(anyObject());
+ doReturn(null).when(queryParameters).remove(any());
when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON);
try {
diff --git a/aai-core/src/test/java/org/onap/aai/PayloadUtil.java b/aai-core/src/test/java/org/onap/aai/PayloadUtil.java
index 7ee6c39c..d9448989 100644
--- a/aai-core/src/test/java/org/onap/aai/PayloadUtil.java
+++ b/aai-core/src/test/java/org/onap/aai/PayloadUtil.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertNotNull;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
@@ -44,7 +45,7 @@ public class PayloadUtil {
String message = String.format("Unable to find the %s in src/test/resources", fileName);
assertNotNull(message, inputStream);
- String resource = IOUtils.toString(inputStream);
+ String resource = IOUtils.toString(inputStream, Charset.defaultCharset());
inputStream.close();
return resource;
@@ -58,7 +59,7 @@ public class PayloadUtil {
String message = String.format("Unable to find the %s in src/test/resources", fileName);
assertNotNull(message, inputStream);
- String resource = IOUtils.toString(inputStream);
+ String resource = IOUtils.toString(inputStream, Charset.defaultCharset());
inputStream.close();
return resource;
@@ -77,7 +78,7 @@ public class PayloadUtil {
if (cache.containsKey(fileName)) {
resource = cache.get(fileName);
} else {
- resource = IOUtils.toString(inputStream);
+ resource = IOUtils.toString(inputStream, Charset.defaultCharset());
cache.put(fileName, resource);
}
diff --git a/aai-core/src/test/java/org/onap/aai/prevalidation/ValidationServiceTest.java b/aai-core/src/test/java/org/onap/aai/prevalidation/ValidationServiceTest.java
index 7f6e5610..d017408f 100644
--- a/aai-core/src/test/java/org/onap/aai/prevalidation/ValidationServiceTest.java
+++ b/aai-core/src/test/java/org/onap/aai/prevalidation/ValidationServiceTest.java
@@ -115,7 +115,7 @@ public class ValidationServiceTest {
String validationResponse =
PayloadUtil.getResourcePayload("prevalidation/success-response-with-empty-violations.json");
- ResponseEntity responseEntity = Mockito.mock(ResponseEntity.class, Mockito.RETURNS_DEEP_STUBS);
+ ResponseEntity<String> responseEntity = Mockito.mock(ResponseEntity.class, Mockito.RETURNS_DEEP_STUBS);
Mockito.when(restClient.execute(eq(ValidationService.VALIDATION_ENDPOINT), eq(HttpMethod.POST), any(),
eq(pserverRequest))).thenReturn(responseEntity);
diff --git a/aai-core/src/test/java/org/onap/aai/rest/NotificationDmaapEventTest.java b/aai-core/src/test/java/org/onap/aai/rest/NotificationDmaapEventTest.java
index cafca63f..399ef7e0 100644
--- a/aai-core/src/test/java/org/onap/aai/rest/NotificationDmaapEventTest.java
+++ b/aai-core/src/test/java/org/onap/aai/rest/NotificationDmaapEventTest.java
@@ -20,7 +20,9 @@
package org.onap.aai.rest;
-import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.junit.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
@@ -29,7 +31,11 @@ import com.google.gson.JsonParser;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
import javax.ws.rs.core.Response;
@@ -848,11 +854,11 @@ public class NotificationDmaapEventTest extends AAISetup {
UEBNotification notification = Mockito.spy(new UEBNotification(ModelType.MOXY, loaderFactory, schemaVersions));
HttpTestUtil httpTestUtil = new HttpTestUtil(queryStyle);
- JsonObject paylaods = new JsonParser().parse(PayloadUtil.getResourcePayload(
- "customer_with_children_and_generic-vnf_with_children_and_edge_between_service-instance_vlan.json"))
- .getAsJsonObject();
- String gvnfPaylaod = paylaods.get("generic-vnf").toString();
- String custPaylaod = paylaods.get("customer").toString();
+ String json = PayloadUtil.getResourcePayload(
+ "customer_with_children_and_generic-vnf_with_children_and_edge_between_service-instance_vlan.json");
+ JsonObject payloads = JsonParser.parseString(json).getAsJsonObject();
+ String gvnfPaylaod = payloads.get("generic-vnf").toString();
+ String custPaylaod = payloads.get("customer").toString();
String gvnfUri = "/aai/v14/network/generic-vnfs/generic-vnf/gvnf";
String custUri = "/aai/v14/business/customers/customer/cust";
String vlanUri = "/aai/v14/network/generic-vnfs/generic-vnf/gvnf/l-interfaces/l-interface/lint/vlans/vlan/vlan";
@@ -909,10 +915,10 @@ public class NotificationDmaapEventTest extends AAISetup {
UEBNotification notification = Mockito.spy(new UEBNotification(ModelType.MOXY, loaderFactory, schemaVersions));
HttpTestUtil httpTestUtil = new HttpTestUtil(queryStyle, notification, AAIProperties.MAXIMUM_DEPTH);
- JsonObject paylaods = new JsonParser()
- .parse(PayloadUtil.getResourcePayload("complex_pserver_with_relation.json")).getAsJsonObject();
- String complexPaylaod = paylaods.get("complex").toString();
- String pserverPaylaod = paylaods.get("pserver").toString();
+ JsonObject payloads = JsonParser
+ .parseString(PayloadUtil.getResourcePayload("complex_pserver_with_relation.json")).getAsJsonObject();
+ String complexPaylaod = payloads.get("complex").toString();
+ String pserverPaylaod = payloads.get("pserver").toString();
String complexUri = "/aai/v14/cloud-infrastructure/complexes/complex/complex-1";
String pserverUri = "/aai/v14/cloud-infrastructure/pservers/pserver/pserver-1";
@@ -955,11 +961,11 @@ public class NotificationDmaapEventTest extends AAISetup {
UEBNotification notification = Mockito.spy(new UEBNotification(ModelType.MOXY, loaderFactory, schemaVersions));
HttpTestUtil httpTestUtil = new HttpTestUtil(queryStyle);
- JsonObject paylaods = new JsonParser().parse(PayloadUtil.getResourcePayload(
- "customer_with_children_and_generic-vnf_with_children_and_edge_between_service-instance_vlan.json"))
- .getAsJsonObject();
- String gvnfPaylaod = paylaods.get("generic-vnf").toString();
- String custPaylaod = paylaods.get("customer").toString();
+ String json = PayloadUtil.getResourcePayload(
+ "customer_with_children_and_generic-vnf_with_children_and_edge_between_service-instance_vlan.json");
+ JsonObject payloads = JsonParser.parseString(json).getAsJsonObject();
+ String gvnfPayload = payloads.get("generic-vnf").toString();
+ String custPayload = payloads.get("customer").toString();
String custUri = "/aai/v14/business/customers/customer/cust";
String ssUri = custUri + "/service-subscriptions/service-subscription/ss";
String siUri = ssUri + "/service-instances/service-instance/si";
@@ -970,7 +976,7 @@ public class NotificationDmaapEventTest extends AAISetup {
// Setup generic vnf
Response response = httpTestUtil.doGet(gvnfUri);
assertEquals("Expecting the generic-vnf to be not found", 404, response.getStatus());
- response = httpTestUtil.doPut(gvnfUri, gvnfPaylaod);
+ response = httpTestUtil.doPut(gvnfUri, gvnfPayload);
assertEquals("Expecting the generic-vnf to be created", 201, response.getStatus());
response = httpTestUtil.doGet(gvnfUri, "all");
assertEquals("Expecting the generic-vnf to be found", 200, response.getStatus());
@@ -981,7 +987,7 @@ public class NotificationDmaapEventTest extends AAISetup {
// Setup customer with service instance relation to vlan
response = httpTestUtil.doGet(custUri);
assertEquals("Expecting the customer to be not found", 404, response.getStatus());
- response = httpTestUtil.doPut(custUri, custPaylaod);
+ response = httpTestUtil.doPut(custUri, custPayload);
assertEquals("Expecting the customer to be created", 201, response.getStatus());
response = httpTestUtil.doGet(custUri, "all");
assertEquals("Expecting the customer to be found", 200, response.getStatus());
diff --git a/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java b/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java
index 1462485d..2499defc 100644
--- a/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java
+++ b/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java
@@ -24,7 +24,7 @@ import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
-import static org.mockito.Matchers.anyObject;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.when;
@@ -33,9 +33,21 @@ import com.google.gson.JsonParser;
import java.io.UnsupportedEncodingException;
import java.net.URI;
-import java.util.*;
-
-import javax.ws.rs.core.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.UriInfo;
import org.javatuples.Pair;
import org.json.JSONArray;
@@ -127,7 +139,7 @@ public class HttpEntryTest extends AAISetup {
when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters);
// TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable
- Mockito.doReturn(null).when(queryParameters).remove(anyObject());
+ Mockito.doReturn(null).when(queryParameters).remove(any());
when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON);
}
@@ -276,7 +288,7 @@ public class HttpEntryTest extends AAISetup {
Response response = doRequest(traversalHttpEntry, loader, dbEngine, HttpMethod.GET, uri, content);
dbEngine.commit();
String msg = response.getEntity().toString();
- JsonObject jsonObj = new JsonParser().parse(msg).getAsJsonObject();
+ JsonObject jsonObj = JsonParser.parseString(msg).getAsJsonObject();
String resourceVersion = "";
if (jsonObj.isJsonObject()) {
resourceVersion = jsonObj.get("resource-version").getAsString();
@@ -298,7 +310,7 @@ public class HttpEntryTest extends AAISetup {
Response response = doRequest(traversalHttpEntry, loader, dbEngine, HttpMethod.GET, uri, content);
dbEngine.commit();
String msg = response.getEntity().toString();
- JsonObject jsonObj = new JsonParser().parse(msg).getAsJsonObject();
+ JsonObject jsonObj = JsonParser.parseString(msg).getAsJsonObject();
String resourceVersion = "";
if (jsonObj.isJsonObject()) {
resourceVersion = jsonObj.get("resource-version").getAsString();
diff --git a/aai-core/src/test/java/org/onap/aai/restcore/RESTAPITest.java b/aai-core/src/test/java/org/onap/aai/restcore/RESTAPITest.java
index 3c099c75..4b73a7d7 100644
--- a/aai-core/src/test/java/org/onap/aai/restcore/RESTAPITest.java
+++ b/aai-core/src/test/java/org/onap/aai/restcore/RESTAPITest.java
@@ -27,7 +27,11 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
-import javax.ws.rs.core.*;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -38,7 +42,7 @@ import org.onap.aai.exceptions.AAIException;
public class RESTAPITest extends AAISetup {
private static RESTAPI restapi;
private static HttpHeaders httpHeaders;
- private static Callable callable;
+ private static Callable<Response> callable;
private static UriInfo info;
private static Response response;
diff --git a/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java b/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java
index 282f6457..f921a77c 100644
--- a/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java
+++ b/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java
@@ -21,14 +21,27 @@
package org.onap.aai.serialization.db;
import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -37,7 +50,12 @@ import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
import org.janusgraph.core.JanusGraphFactory;
-import org.junit.*;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@@ -987,7 +1005,7 @@ public class DbSerializerTest extends AAISetup {
@Test
public void cascadeL3NetworkPreventDeleteTest() throws AAIException, UnsupportedEncodingException {
l3NetworkSetup();
- ArrayList expected_messages = new ArrayList<String>();
+ ArrayList<String> expected_messages = new ArrayList<>();
expected_messages.add(
"Object is being reference by additional objects preventing it from being deleted. Please clean up references from the following types [l3-interface-ipv4-address-list, l3-interface-ipv6-address-list]");
expected_messages.add(
diff --git a/aai-core/src/test/java/org/onap/aai/serialization/db/ImpliedDeleteUnitTest.java b/aai-core/src/test/java/org/onap/aai/serialization/db/ImpliedDeleteUnitTest.java
index 44f89746..27f52d1b 100644
--- a/aai-core/src/test/java/org/onap/aai/serialization/db/ImpliedDeleteUnitTest.java
+++ b/aai-core/src/test/java/org/onap/aai/serialization/db/ImpliedDeleteUnitTest.java
@@ -198,7 +198,7 @@ public class ImpliedDeleteUnitTest {
Mockito.when(mockQueryEngine.findDeletable(Mockito.anyList())).thenReturn(vertices);
- Mockito.when(mockSerializer.getLatestVersionView(Mockito.anyObject())).thenReturn(mockIntrospector);
+ Mockito.when(mockSerializer.getLatestVersionView(Mockito.any())).thenReturn(mockIntrospector);
Mockito.when(mockIntrospector.marshal(false)).thenReturn("{\"volume-id\":\"volume-1\"}")
.thenReturn("{\"volume-id\":\"volume-2\"}").thenReturn("{\"volume-id\":\"volume-3\"}")
@@ -284,7 +284,7 @@ public class ImpliedDeleteUnitTest {
Mockito.when(mockQueryEngine.findDeletable(Mockito.anyList())).thenReturn(vertices);
- Mockito.when(mockSerializer.getLatestVersionView(Mockito.anyObject()))
+ Mockito.when(mockSerializer.getLatestVersionView(Mockito.any()))
.thenThrow(new RuntimeException("Unable to find node"));
impliedDelete.execute(vserver.id(), "SDNC", "vserver", vertices);
diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/MultiFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/MultiFormatTest.java
index 1bfdf9c4..09a1d1b4 100644
--- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/MultiFormatTest.java
+++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/MultiFormatTest.java
@@ -22,7 +22,9 @@ package org.onap.aai.serialization.queryformats;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
@@ -75,16 +77,16 @@ public class MultiFormatTest extends AAISetup {
private Tree<?> resultTree;
private Path resultPath;
private SchemaVersion version;
- private JsonObject expectedTreeIdFormat = new JsonParser().parse(
+ private JsonObject expectedTreeIdFormat = JsonParser.parseString(
"{\"nodes\":[{\"resource-type\":\"generic-vnf\",\"nodes\":[{\"resource-type\":\"vserver\",\"nodes\":[{\"resource-type\":\"pserver\"}]},{\"resource-type\":\"pserver\",\"nodes\":[{\"resource-type\":\"complex\"}]}]}]}")
.getAsJsonObject();
- private JsonObject expectedPathIdFormat = new JsonParser().parse(
+ private JsonObject expectedPathIdFormat = JsonParser.parseString(
"{\"path\":[{\"resource-type\":\"generic-vnf\"},{\"resource-type\":\"vserver\"},{\"resource-type\":\"pserver\"},{\"resource-type\":\"complex\"}]}")
.getAsJsonObject();
- private JsonObject expectedAsTreeWithResourceFormat = new JsonParser().parse(
+ private JsonObject expectedAsTreeWithResourceFormat = JsonParser.parseString(
"{\"results\":[{\"generic-vnf\":{\"vnf-id\":\"vnf-id-1\",\"vnf-name\":\"vnf-name-1\",\"related-nodes\":[{\"vserver\":{\"vserver-id\":\"vserver-id-1\",\"vserver-name\":\"vserver-name-1\",\"related-nodes\":[{\"pserver\":{\"hostname\":\"hostname-1\"}}]}},{\"pserver\":{\"hostname\":\"hostname-2\",\"related-nodes\":[{\"complex\":{\"physical-location-id\":\"physical-location-id-2\",\"country\":\"US\"}}]}}]}}]}")
.getAsJsonObject();
- private JsonObject expectedAsTreeWithSimpleFormat = new JsonParser().parse(
+ private JsonObject expectedAsTreeWithSimpleFormat = JsonParser.parseString(
"{\"results\":[{\"id\":\"0\",\"node-type\":\"generic-vnf\",\"url\":null,\"properties\":{\"vnf-id\":\"vnf-id-1\",\"vnf-name\":\"vnf-name-1\"},\"related-to\":[{\"id\":\"1\",\"relationship-label\":\"tosca.relationships.HostedOn\",\"node-type\":\"vserver\",\"url\":null},{\"id\":\"5\",\"relationship-label\":\"tosca.relationships.HostedOn\",\"node-type\":\"pserver\",\"url\":null}],\"related-nodes\":[{\"id\":\"1\",\"node-type\":\"vserver\",\"url\":null,\"properties\":{\"vserver-id\":\"vserver-id-1\",\"vserver-name\":\"vserver-name-1\"},\"related-to\":[{\"id\":\"0\",\"relationship-label\":\"tosca.relationships.HostedOn\",\"node-type\":\"generic-vnf\",\"url\":null},{\"id\":\"2\",\"relationship-label\":\"tosca.relationships.HostedOn\",\"node-type\":\"pserver\",\"url\":null}],\"related-nodes\":[{\"id\":\"2\",\"node-type\":\"pserver\",\"url\":null,\"properties\":{\"hostname\":\"hostname-1\"},\"related-to\":[{\"id\":\"1\",\"relationship-label\":\"tosca.relationships.HostedOn\",\"node-type\":\"vserver\",\"url\":null},{\"id\":\"3\",\"relationship-label\":\"org.onap.relationships.inventory.LocatedIn\",\"node-type\":\"complex\",\"url\":null}]}]},{\"id\":\"5\",\"node-type\":\"pserver\",\"url\":null,\"properties\":{\"hostname\":\"hostname-2\"},\"related-to\":[{\"id\":\"0\",\"relationship-label\":\"tosca.relationships.HostedOn\",\"node-type\":\"generic-vnf\",\"url\":null},{\"id\":\"6\",\"relationship-label\":\"org.onap.relationships.inventory.LocatedIn\",\"node-type\":\"complex\",\"url\":null}],\"related-nodes\":[{\"id\":\"6\",\"node-type\":\"complex\",\"url\":null,\"properties\":{\"physical-location-id\":\"physical-location-id-2\",\"country\":\"US\"},\"related-to\":[{\"id\":\"5\",\"relationship-label\":\"org.onap.relationships.inventory.LocatedIn\",\"node-type\":\"pserver\",\"url\":null}]}]}]}]}")
.getAsJsonObject();
diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java
index 10178931..e26c56e2 100644
--- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java
+++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java
@@ -20,7 +20,9 @@
package org.onap.aai.serialization.queryformats;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
@@ -130,7 +132,7 @@ public class ResourceFormatTest extends AAISetup {
FormatFactory ff =
new FormatFactory(loader, serializer, schemaVersions, basePath, "https://localhost:8447/aai/");
- MultivaluedMap mvm = new MultivaluedHashMap();
+ MultivaluedMap<String, String> mvm = new MultivaluedHashMap<>();
mvm.add("depth", "0");
Formatter formatter = ff.get(Format.resource, mvm);
diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java
index 279c3e83..7634d22a 100644
--- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java
+++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java
@@ -23,9 +23,9 @@ package org.onap.aai.serialization.queryformats;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyObject;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
@@ -142,7 +142,7 @@ public class SimpleFormatTest extends AAISetup {
FormatFactory ff =
new FormatFactory(loader, serializer, schemaVersions, basePath, "https://localhost:8447/aai/");
- MultivaluedMap mvm = new MultivaluedHashMap();
+ MultivaluedMap<String, String> mvm = new MultivaluedHashMap<>();
mvm.add("depth", "0");
Formatter formatter = ff.get(Format.simple, mvm);
@@ -160,7 +160,7 @@ public class SimpleFormatTest extends AAISetup {
simpleFormat = new RawFormat.Builder(loader, serializer, urlBuilder).nodesOnly(true).depth(0).build();
- when(serializer.dbToObject(anyObject(), anyObject(), anyInt(), anyBoolean(), anyString()))
+ when(serializer.dbToObject(any(), any(), anyInt(), anyBoolean(), anyString()))
.thenThrow(new AAIException("Test Exception"));
simpleFormat.createPropertiesObject(vfModule);
diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/UrlBuilderTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/UrlBuilderTest.java
index c9e061c1..63671447 100644
--- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/UrlBuilderTest.java
+++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/UrlBuilderTest.java
@@ -47,7 +47,7 @@ public class UrlBuilderTest extends AAISetup {
private Vertex v;
private static final String uri = "/test/uri";
- private static final Object vId = new Long(123);
+ private static final Object vId = Long.valueOf(123);
private static final String protocolAndHost = "http://localhost/aai/";
@Before
diff --git a/aai-els-onap-logging/src/main/java/org/onap/aai/logging/LoggingContext.java b/aai-els-onap-logging/src/main/java/org/onap/aai/logging/LoggingContext.java
index 97288af8..d3fbd959 100644
--- a/aai-els-onap-logging/src/main/java/org/onap/aai/logging/LoggingContext.java
+++ b/aai-els-onap-logging/src/main/java/org/onap/aai/logging/LoggingContext.java
@@ -41,7 +41,7 @@ public class LoggingContext {
public static final String BUSINESS_PROCESS_ERROR = "500";
public static final String UNKNOWN_ERROR = "900";
- public static final Map<String, String> responseMap = new HashMap();
+ public static final Map<String, String> responseMap = new HashMap<>();
// Specific Log Event Fields
public static enum LoggingField {
diff --git a/aai-els-onap-logging/src/test/java/org/onap/aai/logging/ErrorObjectTest.java b/aai-els-onap-logging/src/test/java/org/onap/aai/logging/ErrorObjectTest.java
index a0fcf655..a281ba56 100644
--- a/aai-els-onap-logging/src/test/java/org/onap/aai/logging/ErrorObjectTest.java
+++ b/aai-els-onap-logging/src/test/java/org/onap/aai/logging/ErrorObjectTest.java
@@ -31,7 +31,7 @@ public class ErrorObjectTest {
private static final String ERROR_DISPOSITION = "5";
private static final String ERROR_SEVERITY = "ERROR";
private static final String ERROR_CATEGORY = "4";
- private static final Integer ERROR_HTTP_RESPONSE_CODE = new Integer(401);
+ private static final Integer ERROR_HTTP_RESPONSE_CODE = Integer.valueOf(401);
private static final String ERROR_REST_CODE = "3300";
private static final String ERROR_CODE = "4000";
private static final String ERROR_TEXT = "Test data error";
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/PropertyPasswordConfiguration.java b/aai-rest/src/main/java/org/onap/aai/restclient/PropertyPasswordConfiguration.java
index 9ed35def..a6028f9c 100644
--- a/aai-rest/src/main/java/org/onap/aai/restclient/PropertyPasswordConfiguration.java
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/PropertyPasswordConfiguration.java
@@ -24,6 +24,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.Charset;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
@@ -65,7 +66,7 @@ public class PropertyPasswordConfiguration implements ApplicationContextInitiali
if (passwordStream != null) {
String keystorePassword = null;
- keystorePassword = IOUtils.toString(passwordStream);
+ keystorePassword = IOUtils.toString(passwordStream, Charset.defaultCharset());
if (keystorePassword != null) {
keystorePassword = keystorePassword.trim();
}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java b/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java
index 6fd2ab60..44b1fe44 100644
--- a/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java
@@ -53,7 +53,7 @@ public abstract class RestClient {
* @return response of request
* @throws RestClientException on internal rest template exception or invalid url
*/
- public ResponseEntity execute(String uri, HttpMethod method, Map<String, String> headers, String body)
+ public ResponseEntity<String> execute(String uri, HttpMethod method, Map<String, String> headers, String body)
throws RestClientException {
HttpEntity<String> httpEntity;
@@ -79,7 +79,7 @@ public abstract class RestClient {
throw new RestClientException(e.getMessage());
}
log.debug("METHOD={}, URL={}, BODY={}", method, url, httpEntity.getBody());
- ResponseEntity responseEntity = getRestTemplate().exchange(url, method, httpEntity, String.class);
+ ResponseEntity<String> responseEntity = getRestTemplate().exchange(url, method, httpEntity, String.class);
log.trace("RESPONSE={}", responseEntity);
return responseEntity;
}
@@ -94,7 +94,7 @@ public abstract class RestClient {
* @return response of request
* @throws RestClientException on internal rest template exception or invalid url
*/
- public ResponseEntity execute(String uri, String method, Map<String, String> headers, String body)
+ public ResponseEntity<String> execute(String uri, String method, Map<String, String> headers, String body)
throws RestClientException {
return execute(uri, HttpMethod.valueOf(method), headers, body);
}
@@ -108,7 +108,7 @@ public abstract class RestClient {
* @return response of request
* @throws RestClientException on internal rest template exception or invalid url
*/
- public ResponseEntity execute(String uri, HttpMethod method, Map<String, String> headers)
+ public ResponseEntity<String> execute(String uri, HttpMethod method, Map<String, String> headers)
throws RestClientException {
return execute(uri, method, headers, null);
}
@@ -122,14 +122,15 @@ public abstract class RestClient {
* @return response of request
* @throws RestClientException on internal rest template exception or invalid url
*/
- public ResponseEntity execute(String uri, String method, Map<String, String> headers) throws RestClientException {
+ public ResponseEntity<String> execute(String uri, String method, Map<String, String> headers)
+ throws RestClientException {
return execute(uri, HttpMethod.valueOf(method), headers, null);
}
- public ResponseEntity executeResource(String uri, HttpMethod method, Map<String, String> headers, String body)
- throws RestClientException {
+ public ResponseEntity<Resource> executeResource(String uri, HttpMethod method, Map<String, String> headers,
+ String body) throws RestClientException {
- HttpEntity httpEntity;
+ HttpEntity<String> httpEntity;
log.debug("Headers: " + headers.toString());
if (body == null) {
httpEntity = new HttpEntity(getHeaders(headers));
@@ -140,12 +141,12 @@ public abstract class RestClient {
return getRestTemplate().exchange(url, method, httpEntity, Resource.class);
}
- public ResponseEntity getGetRequest(String content, String uri, Map<String, String> headersMap) {
+ public ResponseEntity<String> getGetRequest(String content, String uri, Map<String, String> headersMap) {
return this.execute(uri, HttpMethod.GET, headersMap, content);
}
- public ResponseEntity getGetResource(String content, String uri, Map<String, String> headersMap) {
+ public ResponseEntity<Resource> getGetResource(String content, String uri, Map<String, String> headersMap) {
return this.executeResource(uri, HttpMethod.GET, headersMap, content);
}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java b/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java
index 08060238..9a28c1cb 100644
--- a/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java
@@ -20,7 +20,6 @@
package org.onap.aai.restclient;
-import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.config.ServiceLocatorFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -28,8 +27,9 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public class RestClientFactoryConfiguration {
+ // ServiceLocatorFactoryBean
@Bean
- public FactoryBean restClientFactoryBean() {
+ public ServiceLocatorFactoryBean restClientFactoryBean() {
ServiceLocatorFactoryBean factoryBean = new ServiceLocatorFactoryBean();
factoryBean.setServiceLocatorInterface(RestClientFactory.class);
return factoryBean;
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockRestClient.java b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockRestClient.java
index 74d254b1..16889c7c 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockRestClient.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockRestClient.java
@@ -179,19 +179,16 @@ public class MockRestClient extends RestClient {
public JsonObject getPayload(String filename) throws IOException {
InputStream inputStream = getClass().getClassLoader().getResourceAsStream(filename);
- // InputStream inputStream = new FileInputStream(filename);
-
String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
String message = String.format("Unable to find the %s in src/test/resources", filename);
assertNotNull(message, inputStream);
- JsonParser parser = new JsonParser();
- JsonObject payload = parser.parse(result).getAsJsonObject();
+ JsonObject payload = JsonParser.parseString(result).getAsJsonObject();
return payload;
}
@Override
- public ResponseEntity execute(String uri, HttpMethod method, Map<String, String> headers, String body) {
+ public ResponseEntity<String> execute(String uri, HttpMethod method, Map<String, String> headers, String body) {
String url = "https://localhost:8447/aai/v14/" + uri;
@@ -227,16 +224,17 @@ public class MockRestClient extends RestClient {
headersMap.add("X-FromAppId", "JUNIT");
headersMap.add("X-TransactionId", "JUNIT");
- HttpEntity httpEntity = new HttpEntity(headers);
+ HttpEntity<String> httpEntity = new HttpEntity(headers);
- ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, String.class);
+ ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, String.class);
// mockRestServiceServer.verify();
return responseEntity;
}
@Override
- public ResponseEntity executeResource(String uri, HttpMethod method, Map<String, String> headers, String body) {
+ public ResponseEntity<Resource> executeResource(String uri, HttpMethod method, Map<String, String> headers,
+ String body) {
String url = "https://localhost:8447/aai/v14/" + uri;
@@ -272,9 +270,10 @@ public class MockRestClient extends RestClient {
headersMap.add("X-FromAppId", "JUNIT");
headersMap.add("X-TransactionId", "JUNIT");
- HttpEntity httpEntity = new HttpEntity(headers);
+ HttpEntity<String> httpEntity = new HttpEntity(headers);
- ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, Resource.class);
+ ResponseEntity<Resource> responseEntity =
+ restTemplate.exchange(url, HttpMethod.GET, httpEntity, Resource.class);
// mockRestServiceServer.verify();
return responseEntity;
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/restclient/SchemaRestClientTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/SchemaRestClientTest.java
index cbbc63d3..4b12936e 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/restclient/SchemaRestClientTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/SchemaRestClientTest.java
@@ -50,7 +50,7 @@ public class SchemaRestClientTest {
@Test
public void testGetRequestToSchemaService() {
- ResponseEntity aaiResponse;
+ ResponseEntity<String> aaiResponse;
RestClient restClient = null;
restClient = restClientFactory.getRestClient(SCHEMA_SERVICE);
diff --git a/docs/AAI REST API Documentation/AAIRESTAPI.rst b/docs/AAI REST API Documentation/AAIRESTAPI.rst
index 04cd6c08..c4972e43 100644
--- a/docs/AAI REST API Documentation/AAIRESTAPI.rst
+++ b/docs/AAI REST API Documentation/AAIRESTAPI.rst
@@ -62,7 +62,7 @@ Casablanca (v14)
- A new API called recents API is now available mostly intended for DCAE use.
-- A new and improved bulk api interface is also available now.
+- A new and improved bulk api interface is also available now.
- More details on the above APIs can be found in wiki pages referenced
in sections below.
@@ -193,8 +193,7 @@ Event Specific:
Relationship List
-- The related-link will be a URI and thus not contain
- https://{serverroot} (impacts events)
+- The related-link will be a URI and thus not contain the protocol prefixed
- The related-link will be used on a PUT as the "first choice" to
identify the related resource. The relationship-data structure, which
@@ -333,17 +332,17 @@ To date, there are only five containers:
resources. At the time of construction, the only data we had to
denote service was the service-type from SO. The vnf-type is the
resource.
-
+
2. Service captures the service model instances and this will be
deprecated in the future as things mature
-
+
3. Vnf-image captures information about the resource image needed for
a VNF. This was created due to there being no info available on
the vservers that run on uCPE
-
+
4. Models captures model definitions (subgraph definitions using the
AAI widgets)
-
+
5. named-queries capture subgraph definitions that allow different
data to be retrieved for a given type of asset
@@ -364,7 +363,7 @@ Headers
The following will be used for logging and interface diagnostic purposes.
- * X-FromAppId Unique Application ID assigned to the user of these APIs
+ * X-FromAppId Unique Application ID assigned to the user of these APIs
* X-TransactionId Unique ID that identifies an API request
The X-FromAppId will be assigned to each application by the AAI team.
@@ -403,7 +402,7 @@ HTTP Codes:
- 412 – Precondition failed (If the resource version doesn’t match AAI or arequired resource version isn't sent but should have been
- 415 – Unsupported Media Type
- 500 - Internal Server Error
-
+
Successful PUT responses shall return the following codes:
* 200 (OK): used when an existing resource has been modified and
there is a response buffer
@@ -431,7 +430,7 @@ Failures:
* 400 Bad Request will be returned if headers are missing
* 404 Not Found will be returned if an unknown URL is used
-In addition, the standard response buffer will be structured as follows unless otherwise specified.
+In addition, the standard response buffer will be structured as follows unless otherwise specified.
There are two types of requestErrors.
* Service Exceptions – These exceptions occur when a service is
@@ -446,29 +445,29 @@ Italics are specific to the error returned, and generally described in the notes
.. parsed-literal::
- HTTP/1.1 405 *Method Not Allowed*
- Content-Type: application/json
+ HTTP/1.1 405 *Method Not Allowed*
+ Content-Type: application/json
Content-Length: nnnnn
- Date: *Thu, 04 Jun 2009 02:51:59 GMT*
+ Date: *Thu, 04 Jun 2009 02:51:59 GMT*
{
- “requestError”:{
- “policyException”:{
- “messageId”:"*POL8007*",
- “text”:”*The resource was invoked with an unsupported operation: %1.*”,
+ “requestError”:{
+ “policyException”:{
+ “messageId”:"*POL8007*",
+ “text”:”*The resource was invoked with an unsupported operation: %1.*”,
“variables”: [”*PUT*”]
}
}
-Notes:
+Notes:
+
+a. On the first line, substitute the appropriate status response code.
+
+b. On the second line, substitute the appropriate content type.
-a. On the first line, substitute the appropriate status response code.
-
-b. On the second line, substitute the appropriate content type.
-
c. Express the requestError structure in the required content type (e.g., either JSON or XML). AAI will use JSON.
-
-d. ‘requestError’ contains either a ‘policyException’ or a ‘serviceException’ structure.
-
+
+d. ‘requestError’ contains either a ‘policyException’ or a ‘serviceException’ structure.
+
e. url is optional
In 1512, AAI is introducing a response payload that is possible during a successful PUT. This payload is used to inform the client that, while AAI completed the action requested, the result could be interpreted as a warning or request for additional action, as negotiated with the client.
@@ -524,21 +523,21 @@ true for AAI:
are internal to how we store the data (i.e., it may look like one
resource to our customers but it is expressed as more than one
vertex in our graph)
-
+
* Vertices that are internal to AAI will be deleted when the parent
vertex is deleted, if deletion of the parent leaves the child vertex
orphaned
-
+
* Vertices that are exposed need to be managed using specific rules
for each vertex.
-
+
* Vertices may have more than just parent/child relationships. One
example is a vserver, which will be owned by a tenant and used by a
- VNF.
+ VNF.
URLs Sent To and Retrieved From A&AI
-------------------------------------
+------------------------------------
A&AI receives URLs from clients that point back to that client in
order to get more details about the data sent to A&AI. A&AI expects
@@ -551,7 +550,7 @@ relationship lists and search results. Note that A&AI used to send
URLs but, as reported in the 1707 impacts, these will now be URIs.
A&AI expects space to be %20, and not plus(+).
-
+
The Relationship-List
---------------------
@@ -701,16 +700,16 @@ Successful JSON Response Payload
AAI Resources CRUD APIs
=======================
-The API structure is composed of:
+The API structure is composed of:
- * The HTTP command, which indicates the operation to perform
- * The HTTP URI, which defines what object this operation is related to
- * The HTTP version, which MUST be 1.1
+ * The HTTP command, which indicates the operation to perform
+ * The HTTP URI, which defines what object this operation is related to
+ * The HTTP version, which MUST be 1.1
-Available HTTP commands are:
+Available HTTP commands are:
- * PUT: used to create or update an object
- * DELETE: used to delete an object or a set of objects
+ * PUT: used to create or update an object
+ * DELETE: used to delete an object or a set of objects
* GET : used to query an object or set of objects
* PATCH : used to update specific fields owned by the client doing the update
@@ -724,7 +723,7 @@ The HTTP URI is built according to this pattern:
* {namespace} refers to the API namespace. Supported namespaces are cloud-infrastructure, business, service-design-and-creation, and network
-* {resource} refers to how the object is identified according to the namespace specifications.
+* {resource} refers to how the object is identified according to the namespace specifications.
Example GET Request
@@ -732,11 +731,6 @@ Example GET Request
GET https://aai.onap:8443/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}
-Swagger and XSD:
-----------------
-
-`Offered APIs <../platform/offeredapis.html>`_
-
Data Assumptions
----------------
@@ -927,7 +921,7 @@ Example:
{
"vnf-id": "cscf0001v", <-- This key needs to be here but you cannot modify the key
"regional-resource-zone": null,
- "ipv4-oam-address": "10.10.99.11"
+ "ipv4-oam-address": "10.10.99.11"
}
This payload would result in the generic-vnf with the vnf-id =
@@ -975,7 +969,7 @@ Example
These parameters may be used in combination with each other.
-Example
+Example
.. code::
@@ -996,8 +990,8 @@ demonstrate how the delete scope and edges are documented.
The following table summarizes actions AAI will take upon deletion of a resource, i.e., its default delete scope:
+-----------------------------+--------------------------------------------------------------------+
-| ERROR_IF_ANY_EDGES | If the resource being deleted has any edges at all |
-| | an error should be returned |
+| ERROR_IF_ANY_EDGES | If the resource being deleted has any edges at all |
+| | an error should be returned |
+-----------------------------+--------------------------------------------------------------------+
| ERROR_IF_ANY_IN_EDGES | If the resource being deleted has any edges that point IN towards |
| | it, an error should be returned |
@@ -1059,8 +1053,8 @@ Bulk APIs
---------
The Bulk API allows clients to make multiple requests in a single
-transaction. Please look for additional details on the following wiki
-page: `Bulk API <bulkApi.html>`_
+transaction. Please look for additional details on the Bulk API link
+in the table on contents.
Nodes API
---------
@@ -1075,7 +1069,7 @@ successfully perform that GET. The nodes API allows for more freedom
in querying A&AI, allowing clients to circumvent the need to know
every key in the hierarchy.
-See `Nodes API <nodesApi.html>`_ for more information.
+See Nodes API in the table of contents for more information.
AAI Traversal APIs
==================
@@ -1094,7 +1088,7 @@ nodes to be searched based on certain properties of the nodes. It will
allow search based on properties being set, not set or set to specific
values.
-Please reference `Nodes Query <nodesQuery.html>`_ for details on the
+Please reference Nodes Query in the table of contents for details on the
API and test queries.
@@ -1115,7 +1109,7 @@ AAI supports a search and delete capability that allows a client to
retrieve or delete an instance of a service based on the model
subgraph definition provided to AAI by ASDC.
-The instance filters must uniquely identify a service instance.
+The instance filters must uniquely identify a service instance.
The URL is as follows:
@@ -1230,8 +1224,8 @@ Example reponse
]
}
-id
-^^^
+id
+^^^
Provides an array of objects containing resource-type (AAI's node
type; i.e., pnf) and a URI using the vertex ID from AAI's graph.
@@ -1241,7 +1235,7 @@ type; i.e., pnf) and a URI using the vertex ID from AAI's graph.
PUT /aai/v$/query?format=id
Example Response
-
+
.. code-block:: json
{
@@ -1268,7 +1262,7 @@ i.e., pnf) and a URI using the AAI REST API pathed URIs
PUT /aai/v$/query?format=pathed
Example Response
-
+
.. code-block:: json
{
@@ -1693,7 +1687,7 @@ Example Response
]
}
-
+
Optional Query Parameters
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1704,7 +1698,7 @@ You can pass the depth query parameter to specify how many levels of
children/grandchildren to return. The default depth is 1.
.. code::
-
+
PUT /aai/v$/query?format={format}&depth=0
nodesOnly
@@ -1713,7 +1707,7 @@ nodesOnly
You can pass the nodesOnly query parameter to have the output only
contain the object properties with no relationships.
-.. code::
+.. code::
PUT /aai/v$/query?format={format}&nodesOnly=true
@@ -1764,14 +1758,11 @@ clients should set their timeouts accordingly.
List of Queries and Payloads
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-For a full list of available custom queries, please refer to our
-`Custom Queries <customQueries.html>`_ document
+For a full list of available custom queries, please refer to our Custom Queries in the Table of Contents
Recents API
-----------
The Recents API allows a client to get the list of objects that has
been created or updated recently, up to a maximum of 1 week
-back.
-
-`Recents API <recentsApi.html>`_
+back. Please see the link in the table of contents.
diff --git a/docs/AAI REST API Documentation/AAIRESTAPI_AMSTERDAM.rst b/docs/AAI REST API Documentation/AAIRESTAPI_AMSTERDAM.rst
deleted file mode 100644
index 9dc91f70..00000000
--- a/docs/AAI REST API Documentation/AAIRESTAPI_AMSTERDAM.rst
+++ /dev/null
@@ -1,607 +0,0 @@
-.. contents::
- :depth: 3
-..
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-
-\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
-
-AAI REST API
-++++++++++++
-
-Overview
-========
-
-The AAI REST API provides access to the AAI active inventory graph. The
-API is largely configured off of models and configuration files. Each
-vertex in the graph has an API that can be called separately or, if part
-of a tree structure, as a nested element with one or more generations
-(parent, grandparent, etc.).
-
-The edges of the graph are provisioned using a relationship list
-construct. For PUT methods, a relationship contains the vertex type or
-category (related-to) and a list of relationship data which captures the
-key pieces of data required to uniquely identify the resource. On a GET
-method, the above information and a URL are returned. The URL can be
-used to GET all the details of that object. The URL returned is suitable
-for retrying failed commands but should not be expected to be cacheable
-for very long periods (e.g., the version of the URL may get deprecated
-when the release changes).
-
-Concurrency control for AAI is in place. The assumptions made for the
-implementation are as follows:
-
-- A client always gets a resource before updating through PUT or
- deleting it.
-
-- All resource updates and deletions are done via the AAI REST APIs
-
-- This solution will apply to PUT and DELETE operations.
-
-- The resource-version attribute is now in every container
-
-- The update API is not subject to concurrency control because it is
- only intended to be used by clients who are the definitive source of
- truth for the attributes they are changing. An update through the
- update API will however reset the resource-version so clients using
- PUT and DELETE will not risk updating with stale data.
-
-- The PATCH REST verb is not subject to concurrency control because it
- is only intended to be used by clients who are the definitive source
- of truth for the attributes they are changing. An update through the
- update API will however reset the resource-version so clients using
- PUT and DELETE will not risk updating with stale data.
-
-How to Use this Document
-========================
-
-When you click on the API documentation, you will see the Summary of
-APIs broken down by namespace (e.g., cloud-infrastructure, business,
-network, service-design-and-creation). You can search for **Tag:**
-(matching the explicit case) to move from namespace to namespace through
-the Summary.
-
-Search for **Paths** to skip past the Summary section where there will
-be more detail about each API. Query parameters are provided here, as
-well as links to our error codes.
-
-Search for **Schema definitions** to see the definitions of the
-payloads. In your browser URL, you can type /#/definitions/node-name at
-the end of the html address to skip directly to a payload definition.
-
-Note that the schema definitions now contain information about the
-delete scope of a node (also referenced in this document) and some
-related node information (also reference in this document as Edges).
-
-Once AAI has a model and configured it, the AAI development server can
-be used to generate sample XML and JSON payloads, according to the
-Accept header passed in the request. This is done by calling the
-"plural" version of an API followed by the word example (e.g.,
-/vserver/vservers/example). This returns a GET result array with one
-entry. That single entry can be sent in a PUT request with actual data
-(the resource-id does not need to be in the PUT payload as it is on the
-URL).
-
-Document Conventions
-====================
-
-Information that is largely guidance or aspirational will be show in
-gray italicized text. This information should not be relied upon or
-referenced at this point except with the understanding that it WILL
-change.
-
-**Bold blue text** will be used to cover communication to our clients
-that may not be enforced by AAI. The sources of truth (our clients)
-populate AAI and are expected to send the correct information, having
-applied business rules that live in the client systems.
-
-Deprecation Warnings and History
-================================
-
-V11
-
-API retirements:
-
-- The actions/update API will be retired. Clients must switch to PATCH.
- There is one grandfathered usage for vpe update flows which will be
- retired in v11.
-
-- The edge tag query will be retired.
-
-Notable attribute and/or valid value changes (generally also impacts
-events):
-
-- The persona-model-id and persona-version will be replaced with
- model-invariant-id (same value as persona-model-id) and
- model-version-id (the UUID of the specific version of a model).
- Persona-model-customization-id will be replaced by
- model-customization-id.
-
-- The operational-state attribute will be replaced by
- operational-status and the only valid values will be in-service-path
- and out-of-service-path
-
-- The vpn-binding object will be split in two to reflect more than one
- route-target per binding. The route-target will be a child of
- vpn-binding and some attributes will move from vpn-binding to
- route-target.
-
-- The following license related attributes will be removed from
- generic-vnf: license-key, entitlement-assignment-group-uuid,
- entitlement-resource-uuid, license-assignment-group-uuid, and
- license-key-uuid due to the introduction of the entitlement and
- license children.
-
-Event Specific:
-
-- Normal impacts due to renaming or adding attributes, splitting
- objects, etc. Please see swagger documentation for objects of
- interest.
-
-- In v11, clients that require lineage, children, or relationship
- information need to subscribe to a different DMaaP topic than the
- current one.
-
-Relationship List
-
-- The related-link will be a URI and thus not contain
- https://{serverroot} (impacts events)
-
-- Thhe related-link will be used on a PUT as the "first choice" to
- identify the related resource. The relationship-data structure, which
- contains the unordered set of keys, is still an acceptable way to
- relate two objects but, *if both the relationship-data and the
- related-link are passed, and they don't agree, the related-link will
- be used without warning that the data is inconsistent*.
-
-- The relationship-data will be ignored on PUT.
-
-AAI API Definition
-==================
-
-The API structure is composed of:
-
-- The HTTP command, which indicates the operation to perform
-
-- The HTTP URI, which defines what object this operation is related to
-
-- The HTTP version, which MUST be 1.1
-
-Available HTTP commands are:
-
-- PUT: used to create or update an object
-
-- DELETE: used to delete an object or a set of objects
-
-- GET : used to query an object or set of objects
-
-- PATCH : used to update specific fields owned by the client doing the
- update
-
-The HTTP URI is built according to this pattern:
-
-https://{serverRoot}/{namespace}/{resource}
-
-- (serverRoot} refers to the server base url: hostname+port+base
- path+version. Port and base path are OPTIONAL but AAI will use port
- 8443 and base path aai. The Amsterdam release version will be v11.
-
-- {namespace} refers to the API namespace. Supported namespaces are
- cloud-infrastructure, business, service-design-and-creation, and
- network
-
-- {resource} refers to how the object is identified according to the
- namespace specifications.
-
-Example
-
-GET https://{hostname}:8443/aai
-/v11/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}
-
-The GET requests support a depth query parameter allowing a query to
-stop after it has reached a certain point in the graph. This allows
-clients to minimize the data that is returned to them. A depth=0 returns
-the resource itself and none of its children.
-
-Data Assumptions
-----------------
-
-Given AAI is largely a correlation engine among disparate inventory
-types, AAI will accept values as they are sent, without validating the
-format or value of the input. It is incumbent upon the source of truth
-to provide valid information to AAI.
-
-Clients should do a GET prior to a PUT and change only the data that
-they mean to affect. The REST APIs expect the payload passed to replace
-the resource in AAI. **This is vital in our concurrency scheme. The
-client will be returned an opaque value per entity which needs to be
-returned back in the PUT. AAI will reject the PUT or DELETE if the
-opaque value doesn't match what AAI has stored for that entity.**
-
-If a leaf has been added to a model in vN+1, and a GET/PUT of a vN
-resource is done, AAI should not affect the new leaf (i.e., it should be
-left unchanged).
-
-PUT and Lists
--------------
-
-The PUT verb is used to both create and replace a resource. A given
-resource may have child resources (e.g., customers have service
-subscriptions; tenants have vservers and vservers have volumes).
-
-The following convention will be followed:
-
-If a resource is replaced and there are no tags for children, the
-children that exist will be left alone.
-
-If a resource is replaced and there are tags for children, the children
-will be replaced by the list passed. If the list is empty, then children
-will be deleted.
-
-Note that the relationship list is a type of child resource. The same
-conventions are followed. It is especially critical to ensure that you
-do not send an incomplete relationship list and therefore remove edges
-in the graph. See section 5.10 for more information on relationship
-lists.
-
-PATCH
------
-
-To move towards industry standards and to make our APIs easier to use by
-clients who own specific attributes and do not require AAI to enforce
-concurrency control around them, the PATCH verb has been introduced.
-
-- RFC Algorithm implemented JSON Merge PATCH
- `tools.ietf.org/html/rfc7386 <https://tools.ietf.org/html/rfc7386>`__
-
-- *HTTP Verb = PATCH*
-
-- PATCH requires a Content-Type of "application/merge-patch+json" in
- your HTTP headers.
-
-- PATCH does not support XML
-
-- PATCH does not require a resource version to preform these
- modifications
-
-- Clients should only send what they wish to modify and whose value
- they "own"
-
-Example:
-
-PATCH \ `https://<hostname>:8443/aai/v11/network/generic-vnfs/generic-vnf/cscf0001v <https://aai-int1.test.att.com:8443/aai/v7/network/generic-vnfs/generic-vnf/cscf0001v>`__
-
-    {
-
-      "vnf-id": "cscf0001v", This key needs to be here but you cannot
-modify the key
-
-      "regional-resource-zone": null,
-
-      "ipv4-oam-address": "1.2.3.4"   
-
-}
-
-This payload would result in the generic-vnf with the vnf-id = cscf0001v
-having ipv4-oam-address set to "1.2.3.4" and regional-resource-zone
-having its value removed from the database.
-
-Referential Integrity
----------------------
-
-AAI is primarily a view to the relationships between customers,
-products, services, physical and virtual components, etc. It stores just
-the details it needs to be efficient to its tasks and knows how to get
-more details if needed.
-
-As such, a transaction sent to AAI may be refused if would break
-referential integrity. The referential integrity rules of AAI are still
-evolving as we understand the services and customers that will use us.
-
-AAI uses a graph database on a NoSQL data store. The following are true
-for AAI:
-
-- Some vertices are exposed to the outside world through APIs, others
- are internal to how we store the data (i.e., it may look like one
- resource to our customers but it is expressed as more than one vertex
- in our graph)
-
-- Vertices that are internal to AAI will be deleted when the parent
- vertex is deleted, if deletion of the parent leaves the child vertex
- orphaned
-
-- Vertices that are exposed need to be managed using specific rules for
- each vertex.
-
-- Vertices may have more than just parent/child relationships. One
- example is a vserver, which will be owned by a tenant and used by a
- VNF.
-
-Delete Rules
-------------
-
-The following options are available as actions to be take upon deletion
-of a resource:
-
-- ERROR\_IF\_ANY\_EDGES – If the resource being deleted has any edges
- at all, an error should be returned
-
-- ERROR\_IF\_ANY\_IN\_EDGES – if the resource being deleted has any
- edges that point IN towards it, an error should be returned
-
-- THIS\_NODE\_ONLY – delete the vertex being requested by first
- deleting its edge to other vertices, but do not delete the other
- vertices. Note, the delete will be rejected if the deletion target
- has DEPENDENT children (e.g., tenants that have vservers)
-
-- CASCADE\_TO\_CHILDREN – cascade the delete through vertices who have
- a parentOf relationship to the vertex being deleted, as long as the
- vertex is orphaned by the delete of its parent
-
-- ERROR\_4\_IN\_EDGES\_OR\_CASCADE – error if there are any in edges
- and, if not, cascade to children
-
-Security
---------
-
-All REST APIs must be called using https.
-
-The current release is configured to support BasicAuth. 2-way SSL using
-client certificates should be configured for production deployments or
-as needed.
-
-Headers
--------
-
-The following will be used for logging and interface diagnostic
-purposes.
-
-- X-FromAppId Unique Application ID assigned to the user of these APIs
-
-- X-TransactionId Unique ID that identifies an API request
-
-The X-FromAppId will be assigned to each application by the AAI team.
-The X-TransactionId must be unique to each transaction within the
-context of an X-FromAppId.
-
-OpenECOMP components that call AAI use the Java UUID class to generate
-unique ids for X-TransactionId.
-
-The Accept header should be set to either application/json or
-application/xml.
-
-+-------------------------------+---------------+
-| Client | X-FromAppId |
-+===============================+===============+
-| Policy | Policy |
-+-------------------------------+---------------+
-| Master Service Orchestrator | MSO |
-+-------------------------------+---------------+
-| SDN Controller | SDNC |
-+-------------------------------+---------------+
-| Application Controller | APPC |
-+-------------------------------+---------------+
-
-Response Codes and Error Handling
----------------------------------
-
-HTTP response codes and error codes are described in the API
-documentation.
-
-URLs Sent To and Retrieved From AAI
------------------------------------
-
-AAI receives URLs from clients that point back to that client in order
-to get more details about the data sent to AAI. AAI expects the URLs
-sent by clients (e.g., self links) to be URL encoded (UTF-8) and AAI
-will store them unchanged.
-
-URLs that AAI constructs that point to AAI resources will be returned
-URLEncoded (UTF-8) to clients. This affects URLs in relationship lists
-and search results.
-
-AAI expects space to be %20, and not plus(+).
-
-The Relationship-List
----------------------
-
-The REST interface does not lend itself to creating more than
-parent-child relationships and the backend structure of AAI is a graph.
-A goal of AAI is to do as little coding as possible to introduce a new
-service into the service design and creation environment.
-
-To that end, we've introduced a relationship-list structure. AAI will
-ask its clients to provide certain data in the relationship-list
-structure.
-
-Each relationship has a related-to attribute and a list of key/value
-pairs. The related-to attribute identifies the node type that the
-resource being acted on is to be related to using the data in the
-key/value pairs. AAI will encode a set of rules for each resource type
-to verify that only valid edges are being made. AAI will keep the name
-of the edge itself, the directionality and cardinality, and the edge
-attributes within its own logic.
-
-If an attempt is made to add a relationship to a node that doesn't exist
-(e.g., from a vserver to a vnf, and the vnf doesn't exist), a unique
-message Id (3003) will be returned with a specific error code
-(ERR.5.4.6129). Arguments will tell the client which node type was
-missing (e.g., generic-vnf) and the key data for that node type
-(generic-vnf.vnf-id).
-
-Single relationships can be PUT to the graph in the following way:
-
-.. code-block:: none
-
- https://{serverRoot}/{namespace}/{resource}/relationship-list/relationship
-
-or
-
-.. code-block:: none
-
- https://{hostname}:8443/aai/v11/cloud-infrastructure/pservers/pserver/pserver-123456789-01/p-interfaces/p-interface/p-interface-name-123456789-01/l-interfaces/l-interface/l-interface-name-123456789-01/relationship-list/relationship
-
-with a payload containing the relationship information in XML
-
-.. code-block:: xml
-
- <relationship xmlns="http://org.openecomp.aai.inventory/v11">
- <related-to>logical-link</related-to>
- <relationship-data>
- <relationship-key>logical-link.link-name</relationship-key>
- <relationship-value>logical-link-123456789-01</relationship-value>
- </relationship-data>
- </relationship>
-
-or JSON.
-
-.. code-block:: json
-
- {
- "related-to": "logical-link",
- "relationship-data": [
- {
- "relationship-key": "logical-link.link-name",
- "relationship-value": " logical-link-123456789-01"
- }
- ]
- }
-
-Edges
-=====
-
-The following are the properties used for edge definitions. T is true, F
-is false
-
-- From and To are the node types for the ends of the edges.
-
-- EdgeLabel is the name of the label within the graph.
-
-- Direction shows the direction of the edge.
-
-- Multiplicity shows the multiplicity rule between two nodes. This
- helps govern what AAI does when modifying relationships between edges
- using the relationship REST APIs
-
-- ParentOf indicates whether From is a parent of To.
-
-- UsesResource specifies whether the From node uses resources of the To
- node, to be able to view the data in the context of "what uses what".
-
-- hasDelTarget specifies whether to try to delete the To node when the
- From node is deleted.
-
-- SVC-INFRA (deprecated)
-
-The configuration for different edges supported by the AAI model are
-defined in the DbEdgeRules.java class.
-
-Indexed Attributes
-===================
-
-AAI supports query parameters on its indexed attributes.
-
-As an example, if you wanted to GET a tenant by tenant-name, you would
-do something like
-
-/aai/vX/cloud-infrastructure/cloud-regions/cloud-region/cloud\_owner\_1/cloud-region\_1/tenants/tenant?tenant-name=value
-
-The properties that are indexed are defined in the aai-schema.
-
-Namespaces
-==========
-
-Util Domain
------------
-
-The util domain is where AAI locates utility functions. There is
-currently one utility function, echo, which serves as a ping test that
-authenticated authorized clients can call to ensure there is
-connectivity with AAI.
-
-The URL for the echo utility is:
-
-.. code-block:: none
-
- https://load-balanced-address:8443/aai/util/echo
-
-If the response is unsuccessful, an error will be returned following the
-standard format.
-
-The successful payload returns the X-FromAppId and X-TransactionId sent
-by the client.
-
-Successful XML Response Payload
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. code-block:: xml
-
- <Info>
- <responseMessages>
- <responseMessage>
- <messageId>INF0001</messageId>
- <text>Success X-FromAppId=%1 X-TransactionId=%2 (msg=%3) (rc=%4)</text>
- <variables>
- <variable>XYZ</variable>
- <variable>XYZ123</variable>
- <variable>Successful health check:OK</variable>
- <variable>0.0.0002</variable>
- </variables>
- </responseMessage>
- </responseMessages>
- </Info>
-
-Successful JSON Response Payload
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. code-block:: json
-
- {"responseMessages": {"responseMessage": [{
- "messageId": "INF0001",
- "text": "Success X-FromAppId=%1 X-TransactionId=%2 (msg=%3) (rc=%4)",
- "variables": {"variable": [
- "XYZ",
- "XYZ123",
- "Successful health check:OK",
- "0.0.0002"
- ]}
- }]}}
-
-Cloud Infrastructure Domain
----------------------------
-
-The Cloud Infrastructure domain (cloud-infrastructure) represents the
-assets managed within a cloud infrastructure site. This includes the
-physical servers, tenants, vservers and cloud-region.
-
-Network Domain
---------------
-
-The network namespace contains virtual and physical network resources as
-well as connection resources such as physical links, logical links, etc.
-
-Business Domain
----------------
-
-The business namespace captures customers, service subscriptions, and
-service instances. This domain is immature and will be evolving as
-service design and creation starts to gel.
-
-Service Design and Creation
----------------------------
-
-The service design and creation namespace captures data we invented
-based on what we thought SDC would eventually provide.
-
-To date, there are only five containers:
-
-1. Service-capabilities capture the pairings of service to resources.
-
-2. Service captures the service model instances and this will be
- deprecated in the future as things mature
-
-3. Models captures model definitions (subgraph definitions using the AAI
- widgets)
-
-4. named-queries capture subgraph definitions that allow different data
- to be retrieved for a given type of asset
diff --git a/docs/AAI REST API Documentation/AAIRESTAPI_CASABLANCA.rst b/docs/AAI REST API Documentation/AAIRESTAPI_CASABLANCA.rst
deleted file mode 100644
index a15c8f51..00000000
--- a/docs/AAI REST API Documentation/AAIRESTAPI_CASABLANCA.rst
+++ /dev/null
@@ -1,1727 +0,0 @@
-.. contents::
- :depth: 3
-..
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-
-\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
-
-==============
- AAI REST API
-==============
-
-Overview
-========
-
-The AAI REST API provides access to the AAI active inventory graph. The
-API is largely configured off of models and configuration files. Each
-vertex in the graph has an API that can be called separately or, if part
-of a tree structure, as a nested element with one or more generations
-(parent, grandparent, etc.).
-
-The edges of the graph are provisioned using a relationship list
-construct. For PUT methods, a relationship contains the vertex type or
-category (related-to) and a list of relationship data which captures the
-key pieces of data required to uniquely identify the resource. On a GET
-method, the above information and a URL are returned. The URL can be
-used to GET all the details of that object. The URL returned is suitable
-for retrying failed commands but should not be expected to be cacheable
-for very long periods (e.g., the version of the URL may get deprecated
-when the release changes).
-
-The REST API describes each API that AAI provides, independent of the
-caller of the API, therefore there is no information to be found here
-regarding the expectations on the callers. That information is
-conveyed in AID documents for each client. AIDs will describe the
-information expected from specific clients, but may not contain the
-full payloads that would be needed on an update. Please see the
-concurrency notes referenced below in order to do the right kind of
-PUTs (GET, replace just what you are changing, PUT) or use the PATCH
-capability.
-
-Deprecation Warnings and History
-================================
-
-AAI will maintain backwards compatibility for two prior releases.
-This means, with the introduction of v14 AAI will support **v11**
-(Amsterdam), **v13** (Beijing), and **v14** (Casablanca)
-
-Casablanca (v14)
-----------------
-
-- A new API called recents API is now available mostly intended for DCAE use.
-
-- A new and improved bulk api interface is also available now.
-
-- More details on the above APIs can be found in wiki pages referenced
- in sections below.
-
-Beijing (v13)
--------------
-
-- To handle security vulnerabilities that were raised as part of Nexus
- IQ scans in ONAP, the APIs are being hosted on a spring-boot with
- Jetty web container.
-
-- The deletion rules are now applied to all the nodes that will be
- deleted by the delete request.
-
- For example, if the graph is:
-
- +------+----------+
- |nodeA | nodeD |
- +------+----------+
-
- If nodeA is parent of nodeB and nodeB is parent of nodeC
-
- +------+---------------------+
- |nodeA | CASCADE_TO_CHILDREN |
- +------+---------------------+
- |nodeB | CASCADE_TO_CHILDREN |
- +------+---------------------+
- |nodeC | ERROR_IF_IN_EDGES |
- +------+---------------------+
-
-- If request is to delete nodeA, it would fail because nodeC has an in
- edge from a node not being deleted in this transaction.
-
-- A configurable server timeout was implemented to make sure the AAI
- server did not continue processing the request long after a client
- times out on their side. An error code ERR.5.4.7406 will be returned
- when this limit is hit. A configuration for clients known to have
- longer running queries currently overrides the default value.
-
-- To handle a risk identified by Fortify scans, a maxOccurs of 5000
- was added to the XSD.
-
-API changes
-~~~~~~~~~~~
-
-- DELETE request will generate a DMAAP event for each node deleted
- (not just the for which the DELETE request was made)
-
-- Relationship list
-
- Starting with Casablanca, multiple edges can exist
- in the graph between the same 2 nodes. The REST API has been
- enhanced via changing the relationship-list so clients can specify
- which edge they are creating and differentiate multiple edges
- between the same 2 nodes. Backwards compatibility with older API
- versions that do notspecify the edge will be maintained.
-
-- A new property “relationship-label” has been added that when
- specified will be used to create any new edge. If not specified the
- default edge label between the two nodes will be used. The
- relationship-label will always be returned with the v12 version of
- GETs whenever the relationship-list is returned.
-
-.. code-block:: json
-
- {
- "relationship-list": {
- "relationship": [
- {
- "related-link": "/aai/v12/cloud-infrastructure/complexes/complex/6d8f945d-8bd2-4fa2-ad37-36b21fc8fb23-PS2418",
- "related-to": "complex",
- "relationship-data": [
- {
- "relationship-key": "complex.physical-location-id",
- "relationship-value": "6d8f945d-8bd2-4fa2-ad37-36b21fc8fb23-PS2418"
- }
- ],
- "relationship-label": "locatedIn"
- }
- ]
- }
- }
-
-Amsterdam (v11)
----------------
-
-API retirements:
-
-- The actions/update API will be retired. Clients must switch to PATCH.
- There is one grandfathered usage for vpe update flows which will be
- retired in v11.
-
-- The edge tag query will be retired.
-
-Notable attribute and/or valid value changes (generally also impacts
-events):
-
-- The persona-model-id and persona-version will be replaced with
- model-invariant-id (same value as persona-model-id) and
- model-version-id (the UUID of the specific version of a model).
- Persona-model-customization-id will be replaced by
- model-customization-id.
-
-- The operational-state attribute will be replaced by
- operational-status and the only valid values will be in-service-path
- and out-of-service-path
-
-- The vpn-binding object will be split in two to reflect more than one
- route-target per binding. The route-target will be a child of
- vpn-binding and some attributes will move from vpn-binding to
- route-target.
-
-- The following license related attributes will be removed from
- generic-vnf: license-key, entitlement-assignment-group-uuid,
- entitlement-resource-uuid, license-assignment-group-uuid, and
- license-key-uuid due to the introduction of the entitlement and
- license children.
-
-Event Specific:
-
-- Normal impacts due to renaming or adding attributes, splitting
- objects, etc. Please see swagger documentation for objects of
- interest.
-
-- In v11, clients that require lineage, children, or relationship
- information need to subscribe to a different DMaaP topic than the
- current one.
-
-Relationship List
-
-- The related-link will be a URI and thus not contain
- https://{serverroot} (impacts events)
-
-- The related-link will be used on a PUT as the "first choice" to
- identify the related resource. The relationship-data structure, which
- contains the unordered set of keys, is still an acceptable way to
- relate two objects but, *if both the relationship-data and the
- related-link are passed, and they don't agree, the related-link will
- be used without warning that the data is inconsistent*.
-
-- The relationship-data will be ignored on PUT.
-
-Future Warning
-==============
-
-In the future, the hope is that individual node definitions will be
-separately versioned from API behavior and from one another (e.g.,
-vserver hasn't changed in many releases and so doesn't need to have
-its "definition" version updated).
-
-Because relationships are starting to become more complex, it may be
-necessary for AAI to expose to clients the exact relationship between
-two nodes. This will likely be done with a relationship-type
-attribute of relationships in the relationship-list.
-
-To support the concept of events getting generated on specific changed
-items, AAI will be migrating towards a model of asking clients to do
-the most granular PUTs possible rather than leveraging the nested
-elements of a tree structure.
-
-The vce, port-group, cvlan-tag, newvce, vpe, oam-network, and
-dvs-switch objects will eventually be deprecated in favor of
-generic-vnf, l3-network, ctag-assignment, segmentation-assignment, and
-TBD.
-
-L3-network will eventually be replaced by virtual-network.
-
-How to Use this Document
-========================
-
-The only attributes in our objects that are declared required are
-those which we know will be present at the creation of each object and
-which are needed to support the construction of the AAI Graph. This
-does not imply that one of AAI's clients doesn't need data.
-
-When you click on the API documentation, you will see the Summary of
-APIs broken down by namespace (e.g., cloud-infrastructure, business,
-network, service-design-and-creation). You can search for **Tag:**
-(matching the explicit case) to move from namespace to namespace through
-the Summary.
-
-Search for **Paths** to skip past the Summary section where there will
-be more detail about each API. Query parameters are provided here, as
-well as links to our error codes.
-
-Search for **Schema definitions** to see the definitions of the
-payloads. In your browser URL, you can type /#/definitions/node-name at
-the end of the html address to skip directly to a payload definition.
-
-Note that the schema definitions now contain information about the
-delete scope of a node, edges, and some related node information.
-Given this information can now be generated, it is no longer repeated
-in this document.
-
-Once AAI has a model and configured it, the AAI development server can
-be used to generate sample XML and JSON payloads, according to the
-Accept header passed in the request. This is done by calling the
-"plural" version of an API followed by the word example (e.g.,
-/vserver/vservers/example). This returns a GET result array with one
-entry. That single entry can be sent in a PUT request with actual data
-(the resource-id does not need to be in the PUT payload as it is on the
-URL).
-
-Finally, custom queries that are not simple GETs of a resource must be
-identified to AAI as separate user stories. This includes searching
-for a resource with other attributes on the same resource, as well as
-searching for resources based on their relationship with other
-objects.
-
-AAI API Definition
-==================
-
-Namespaces
-----------
-
-Cloud Infrastructure Domain
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The Cloud Infrastructure domain (cloud-infrastructure) represents the
-assets managed within a cloud site. This includes the complex, the
-physical servers, the availability zones, oam-networks, tenants, and
-vserver-related resources (vservers, flavors, images, etc.).
-
-Tenants, oam-networks, availability-zones, volume-groups, images,
-flavors, and dvs-switches will have cloud-region as its parent node.
-
-Network Domain
-~~~~~~~~~~~~~~
-
-The network namespace contains virtual and physical network resources
-as well as connection resources such as physical links, logical links,
-lag links, etc.
-
-The vce/port-group/cvlan-tag tree represents an immature model that
-blended several resources together in ways that were expedient but
-which need to be re-evaluated. A newvce object exists which was the
-basis of the generic-vnf object. Future efforts will attempt to
-migrate vce and vpe into generic-vnf.
-
-Business Domain
-~~~~~~~~~~~~~~~
-
-The business namespace captures customers, service-subscriptions, and
-service-instances. This domain is immature and will be evolving as
-service design and creation starts to gel.
-
-Customers and service-subscriptions in particular will be evolving
-soon. Any service that is customer facing will see customer and
-service-subscription data offboarding to BSSs. The
-service-instance-id will be the "join point" within the BSS to
-correlate the service-instance to the product and customer. Services
-that are for infrastructure purposes will have a new entity, an
-owning-entity, to replace the customer. The owning-entity will be
-related to the SDC service models that use it.
-
-Service Design and Creation
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The service design and creation namespace captures data we invented
-based on what we thought SDC would eventually provide. The structure
-of that data is definitely not what the current plans are for SDC
-however we need to at least capture the spirit of what's intended and
-communicate that across ONAP sub components that need it.
-
-To date, there are only five containers:
-
-1. Service-capabilities capture the pairings of service to
- resources. At the time of construction, the only data we had to
- denote service was the service-type from SO. The vnf-type is the
- resource.
-
-2. Service captures the service model instances and this will be
- deprecated in the future as things mature
-
-3. Vnf-image captures information about the resource image needed for
- a VNF. This was created due to there being no info available on
- the vservers that run on uCPE
-
-4. Models captures model definitions (subgraph definitions using the
- AAI widgets)
-
-5. named-queries capture subgraph definitions that allow different
- data to be retrieved for a given type of asset
-
-Security
---------
-
-All REST APIs must be called using https.
-
-HTTPS Basic Authentication will be used to authenticate clients. The
-remote user from the HTTP Servlet Request is used against an AAI
-policy to see if the authenticated user is authorized for the resource
-and actions being request.
-
-Client should use credentials provided to their system via AAF.
-
-The following will be used for logging and interface diagnostic purposes.
-
- * X-FromAppId Unique Application ID assigned to the user of these APIs
- * X-TransactionId Unique ID that identifies an API request
-
-The X-FromAppId will be assigned to each application by the AAI team.
-The X-TransactionId must be unique to each transaction within the
-context of an X-FromAppId.
-
-SO, SDN-C, and AAI have agreed to use the Java UUID class to generate
-unique ids for X-TransactionId.
-
-The Accept and Content-type header should be set to either
-application/json or application/xml except as documented for PATCH.
-
-Response Codes and Error Handling
----------------------------------
-
-AAI will use the following HTTP codes
-
-HTTP Codes:
-~~~~~~~~~~~
-
-- 200 – Success
-- 201 – Created
-- 202 - Accepted
-- 204 – Success, no payload returned
-- 400 - Bad Request
-- 401 - Unauthorized
-- 403 - Forbidden
-- 404 - Not Found
-- 405 – Method Not Allowed
-- 409 - The request could not be completed due to a conflict with the
- current state of the target resource. This code is used in situations
- where the user might be able to resolve the conflict and resubmit the
- request. If the resource version doesn’t match AAI or a required
- resource version isn't sent but should have been
-- 410 - You are using a version of the API that has been retired
-- 412 – Precondition failed (If the resource version doesn’t match AAI or arequired resource version isn't sent but should have been
-- 415 – Unsupported Media Type 500 - Internal Server Error
-
-Successful PUT responses shall return the following codes:
- * 200 (OK): used when an existing resource has been modified and
- there is a response buffer
- * 201 (Created): MUST be used when a new resource is created
- * 202 (Accepted): used when AAI completed the action requested but
- may have taken other actions as well, which are returned in the
- response payload
- * 204 (No Content): used when the existing resource has been modified
- and there is no response buffer
-
-Successful DELETE responses shall return the following codes:
- * 200 (OK): for a successful response if the response includes an
- entity describing the status.
- * 204 (No Content): if the action has been enacted but the response
- does not include an entity.
-
-Successful GET responses shall return the following codes:
- * 200 (OK): for a successful response for a resource that has been found
- * 404 (Not Found) for a successful response retrieving a list of
- items and there were no items found, i.e., the GET of the specific
- plural resource was not found
- * 404 (Not Found): when a specific resource was not found
-
-Failures:
- * 400 Bad Request will be returned if headers are missing
- * 404 Not Found will be returned if an unknown URL is used
-
-In addition, the standard response buffer will be structured as follows unless otherwise specified.
-There are two types of requestErrors.
-
- * Service Exceptions – These exceptions occur when a service is
- unable to process a request and retrying the request will result in
- a consistent failure (e.g., an application provides invalid input).
- * Policy Exceptions – These exceptions occur when a policy criteria
- has not been met (e.g., the (N+1)th request arrives when an
- application’s service level agreement only allows N transactions
- per time interval).
-
-Italics are specific to the error returned, and generally described in the notes
-
-.. parsed-literal::
-
- HTTP/1.1 405 *Method Not Allowed*
- Content-Type: application/json
- Content-Length: nnnnn
- Date: *Thu, 04 Jun 2009 02:51:59 GMT*
- {
- “requestError”:{
- “policyException”:{
- “messageId”:"*POL8007*",
- “text”:”*The resource was invoked with an unsupported operation: %1.*”,
- “variables”: [”*PUT*”]
- }
- }
-
-Notes:
-
-a. On the first line, substitute the appropriate status response code.
-
-b. On the second line, substitute the appropriate content type.
-
-c. Express the requestError structure in the required content type (e.g., either JSON or XML). AAI will use JSON.
-
-d. ‘requestError’ contains either a ‘policyException’ or a ‘serviceException’ structure.
-
-e. url is optional
-
-In 1512, AAI is introducing a response payload that is possible during a successful PUT. This payload is used to inform the client that, while AAI completed the action requested, the result could be interpreted as a warning or request for additional action, as negotiated with the client.
-
-Sample response to a vserver PUT where the pserver and complex did not exist:
-
-.. code-block:: json
-
- {"responseMessages": {"responseMessage": [
- {
- "messageId": "INF0003",
- "text": "Success with additional info performing %1 on %2. Added %3 with key %4 (msg=%5) (rc=%6)",
- "variables": {"variable": [
- "PUTvserver",
- "ccwvm388",
- "complex",
- "physical-location-id=fakeccwcomplex",
- "Added prerequisite object to db:complex",
- "0.3.0004"
- ]}
- },
- {
- "messageId": "INF0003",
- "text": "Success with additional info performing %1 on %2. Added %3 with key %4 (msg=%5) (rc=%6)",
- "variables": {"variable": [
- "PUTvserver",
- "ccwvm388",
- "pserver",
- "hostname=fakeccwpserver",
- "Added prerequisite object to db:pserver",
- "0.3.0004"
- ]}
- }
- ]}}
-
-Referential Integrity
----------------------
-
-AAI is primarily a view to the relationships between instances of
-services, physical and virtual components, etc. It stores just the
-details it needs to be efficient to its tasks and knows how to get
-more details if needed.
-
-As such, a transaction sent to AAI may be refused if would break
-referential integrity. The referential integrity rules of AAI are
-still evolving as we understand the services and customers that will
-use us.
-
-AAI uses a graph database on a NoSQL data store. The following are
-true for AAI:
-
-* Some vertices are exposed to the outside world through APIs, others
- are internal to how we store the data (i.e., it may look like one
- resource to our customers but it is expressed as more than one
- vertex in our graph)
-
-* Vertices that are internal to AAI will be deleted when the parent
- vertex is deleted, if deletion of the parent leaves the child vertex
- orphaned
-
-* Vertices that are exposed need to be managed using specific rules
- for each vertex.
-
-* Vertices may have more than just parent/child relationships. One
- example is a vserver, which will be owned by a tenant and used by a
- VNF.
-
-The Relationship-List
----------------------
-
-The REST interface does not lend itself to creating more than
-parent-child relationships and the backend structure of AAI is a
-graph. A goal of AAI, and shared with ONAP, is to do as little coding
-as possible to introduce a new service into the service design and
-creation environment.
-
-To that end, we've introduced a relationship-list structure. AAI will
-ask its clients to provide certain data in the relationship-list
-structure.
-
-Each relationship has a related-to attribute and a list of key/value
-pairs. The related-to attribute identifies the node type that the
-resource being acted on is to be related to using the data in the
-key/value pairs. AAI will encode a set of rules for each resource
-type to verify that only valid edges are being made. AAI will keep
-the directionality and cardinality, and the edge attributes within its
-own logic. In the near future, the definition of relationships, their
-validity, and cardinality will be captured in the ONAP TOSCA models.
-
-AAI also has a concept of a related-to category. To date, the only
-category is vnf. The vnf category is used as the related-to value to
-indicate that the relationship being establish is to a Virtual Network
-Function of unknown type. The vnf-id happens to be unique for all
-services across all nodes in the graph. By providing vnf.vnf-id with
-a specific value, AAI can look at all VNFs in the graph and find the
-appropriate vertex. Note that this only applies to PUTs.
-
-Category vnf is used for node types of vce, vpe, and generic-vnf.
-
-If an attempt is made to add a relationship to a node that doesn't
-exist (e.g., from a vserver to a vnf, and the vnf doesn't exist), a
-unique message Id (3003) will be returned with a specific error code
-(ERR.5.4.6129). Arguments will tell the client which node type was
-missing (e.g., vnf) and the key data for that node type (vnf.vnf-id).
-
-Single relationships can be PUT to the graph in the following way:
-
-.. code::
-
- https://{serverRoot}/{namespace}/{resource}/relationship-list/relationship
-
-or
-
-.. code::
-
- https://aai/v10/cloud-infrastructure/pservers/pserver/pserver-123456789-01/p-interfaces/p-interface/p-interface-name-123456789-01/l-interfaces/l-interface/l-interface-name-123456789-01/relationship-list/relationship
-
-with a payload containing the relationship information.
-
-AAI will accept and give preference to the related-link URI
-
-XML
-
-.. code-block:: xml
-
- <relationship xmlns="http://org.onap.aai.inventory/vX">
- <related-link>*/aai/v10/network/logical-links/logical-link/logical-link-123456789-01*</related-link>
- <related-to>logical-link</related-to>
- <relationship-data>
- <relationship-key>logical-link.link-name</relationship-key>
- <relationship-value>logical-link-123456789-01</relationship-value>
- </relationship-data>
- </relationship>
-
-JSON
-
-.. code-block:: json
-
- {
- "related-link": " /aai/v10/network/logical-links/logical-link/logical-link-123456789-01",
- "related-to": "logical-link",
- "relationship-data": [
- {
- "relationship-key": "logical-link.link-name",
- "relationship-value": " logical-link-123456789-01"
- }
- ]
- }
-
-Health Check API
-----------------
-
-The util domain is where AAI locates utility functions. There is
-currently one utility function, echo, which serves as a ping test that
-authenticated authorized clients can call to ensure there is
-connectivity with AAI.
-
-The URL for the echo utility is:
-
-.. code::
-
- https://aai.onap:8443/aai/util/echo
-
-If the response is unsuccessful, an error will be returned following
-the standard format.
-
-The successful payload returns the X-FromAppId and X-TransactionId
-sent by the client.
-
-Successful XML Response Payload
--------------------------------
-
-.. code-block:: xml
-
- <Info>
- <responseMessages>
- <responseMessage>
- <messageId>INF0001</messageId>
- <text>Success X-FromAppId=%1 X-TransactionId=%2 (msg=%3) (rc=%4)</text>
- <variables>
- <variable>CCW</variable>
- <variable>CCW33335</variable>
- <variable>Successful health check:OK</variable>
- <variable>0.0.0002</variable>
- </variables>
- </responseMessage>
- </responseMessages>
- </Info>
-
-Successful JSON Response Payload
---------------------------------
-
-.. code-block:: json
-
- {
- "responseMessages": {
- "responseMessage": [
- {
- "messageId": "INF0001",
- "text": "Success X-FromAppId=%1 X-TransactionId=%2 (msg=%3) (rc=%4)",
- "variables": {
- "variable": [
- "CCW",
- "CCW33335",
- "Successful health check:OK",
- "0.0.0002"
- ]
- }
- }
- ]
- }
- }
-
-AAI Resources CRUD APIs
-=======================
-
-The API structure is composed of:
-
- * The HTTP command, which indicates the operation to perform
- * The HTTP URI, which defines what object this operation is related to
- * The HTTP version, which MUST be 1.1
-
-Available HTTP commands are:
-
- * PUT: used to create or update an object
- * DELETE: used to delete an object or a set of objects
- * GET : used to query an object or set of objects
- * PATCH : used to update specific fields owned by the client doing the update
-
-The HTTP URI is built according to this pattern:
-
-.. code::
-
- https://{serverRoot}/{namespace}/{resource}
-
-* {serverRoot} refers to the server base url: hostname+port+base path+version. Port and base path are OPTIONAL but AAI will use port 8443 and base path aai. Note that the base path may change before production, so please make this configurable. Versions will change as releases are made.
-
-* {namespace} refers to the API namespace. Supported namespaces are cloud-infrastructure, business, service-design-and-creation, and network
-
-* {resource} refers to how the object is identified according to the namespace specifications.
-
-Example GET Request
-
-.. code::
-
- GET https://aai.onap:8443/aai /v11/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}
-
-Swagger and XSD:
-----------------
-
-`Offered APIs <../platform/offeredapis.html>`_
-
-Data Assumptions
-----------------
-
-Given AAI is largely a correlation engine among disparate inventory
-types, AAI will for the most part accept values as they are sent,
-without validating the format or value of the input. **It is
-incumbent upon the source of truth to provide valid information to
-AAI.**
-
-Clients should either use the PATCH API (section 7.5) to only change
-the attribute values they mean to change, or do a GET prior to a PUT
-and change only the data that they mean to affect.
-
-The PUT REST APIs expect the payload passed to replace the resource in
-AAI. **A GET before PUT is vital in our concurrency scheme. The
-client will be returned an opaque value per entity which needs to be
-returned back in the PUT. AAI will reject the PUT or DELETE if the
-opaque value doesn't match what AAI has stored for that entity.**
-
-If an attribute has been added to a model in vN+1, and a GET/PUT of a
-vN resource is done, AAI should not affect the new attribute (i.e., it
-should be left unchanged).
-
-Concurrency Control
--------------------
-
-Concurrency control for AAI is in place.
-
-* A client always gets a resource before updating through PUT or deleting it.
-
-* All resource updates and deletions are done via the AAI REST APIs
-
-* This solution will apply to PUT and DELETE operations.
-
-* The resource-version attribute is now in every container
-
-* The PATCH REST verb is not subject to concurrency control, because
- it is only intended to be used by clients who are the definitive
- source of truth for the attributes they are changing. An update
- through the PATCH API will however reset the resource-version so
- clients using PUT and DELETE will not risk updating with stale data.
- If a client would like us to do concurrency control for PATCH, we
- will need a feature request. PATCH is recommended for clients who
- know they are the definitive source of data, as there is less risk
- of destroying other data.
-
-If you use PUT, you MUST send back the entire resource, not just the
-pieces you know about. This is best illustrated by example. Note:
-Specific interfaces only show you the data you are responsible for but
-that does not mean that's all the data that the resource you GET will
-contain. You are responsible to overlay only your changes and leave
-everything else untouched.
-
-Imagine this is the existing resource:
-
-.. code-block:: json
-
- {
- "node-id": "valueOfNodeId",
- "node-name": "valueOfNodeName",
- "prov-status": "NVTPROV",
- "relationship-list": {
- "relationship": [
- {
- "related-link": " /aai/v10/network/generic-vnfs/generic-vnf/generic-vnf-20160902a",
- "related-to": "generic-vnf",
- "relationship-data": [
- {
- "relationship-key": "generic-vnf.vnf-id",
- "relationship-value": "generic-vnf-20160902a"
- }
- ]
- },
- {
- "related-link": " /aai/v10/network/generic-vnfs/generic-vnf/generic-vnf-20161010",
- "related-to": "generic-vnf",
- "relationship-data": [
- {
- "relationship-key": "generic-vnf.vnf-id",
- "relationship-value": "generic-vnf-20161010"
- }
- ]
- }
- ]
- },
- "resource-version": "1474912794"
- }
-
-And you want to update the name and add a relationship to an l3-network.
-
-The payload you need to send back, if you choose PUT, is this. The
-node-name and the third relationship block is the new data, and the
-other data and relationships previously existed and must still be PUT.
-
-.. code-block:: json
-
- {
- "node-id": "valueOfNodeId",
- "node-name": "NEWvalueOfNodeName",
- "prov-status": "NVTPROV",
- "relationship-list": {
- "relationship": [
- {
- "related-link": " /aai/v10/network/generic-vnfs/generic-vnf/generic-vnf-20160902a",
- "related-to": "generic-vnf",
- "relationship-data": [
- {
- "relationship-key": "generic-vnf.vnf-id",
- "relationship-value": "generic-vnf-20160902a"
- }
- ]
- },
- {
- "related-link": " /aai/v10/network/generic-vnfs/generic-vnf/generic-vnf-20161010",
- "related-to": "generic-vnf",
- "relationship-data": [
- {
- "relationship-key": "generic-vnf.vnf-id",
- "relationship-value": "generic-vnf-20161010"
- }
- ]
- },
- {
- "related-link": " /aai/v10/network/l3-networks/l3-network/network-name-for-me",
- "related-to": "l3-network",
- "relationship-data": [
- {
- "relationship-key": "l3-network.network-name",
- "relationship-value": "network-name-for-me"
- }
- ]
- }
- ]
- },
- "resource-version": "1474912794"
- }
-
-A Warning About PUT and Lists
------------------------------
-
-The PUT verb is used to both create and replace a resource. A given
-resource may have child resources (e.g., customers have service
-subscriptions, generic-vnfs have vf-modules, tenants have vservers and
-vservers have volumes).
-
-The following convention will be followed:
-
- If a resource is replaced and there are no tags for children, the
- children that exist will be left alone.
-
- If a resource is replaced and there are tags for children, the
- children will be replaced by the list passed. If the list is empty,
- then children will be deleted.
-
-Note that the relationship list is a type of child resource. The same
-conventions are followed. It is especially critical to ensure that
-you do not send an incomplete relationship list and therefore remove
-edges in the graph. See `The Relationship-List`_ for more information on
-relationship lists. See `Concurrency Control`_ for an example of GET followed by
-PUT containing the entire resource (i.e., overlaying your changes on
-what already exists so that you don't wipe out other data).
-
-PATCH
------
-
-To move towards industry standards and to make our APIs easier to use
-by clients who own specific attributes and do not require AAI to
-enforce concurrency control around them, the PATCH verb has been
-introduced.
-
-.. _RFC 7386: https://tools.ietf.org/html/rfc7386
-
-- RFC Algorithm implemented JSON Merge PATCH: `RFC 7386`_
-- HTTP Verb = PATCH
-- Clients can send a POST with "X-HTTP-Method-Override" = "PATCH" and
- Content-Type = "application/merge-patch+json" to send a PATCH
- request to AAI.
-- PATCH does not support XML
-- PATCH does not require a resource version to preform these modifications
-- Clients should only send what they wish to modify and whose value they "own"
-- PATCH returns a 200 with no response body for success
-
-Example:
-
-.. code::
-
- PATCH https://aai.onap:8443/aai/v10/network/generic-vnfs/generic-vnf/cscf0001v
- {
- "vnf-id": "cscf0001v", <-- This key needs to be here but you cannot modify the key
- "regional-resource-zone": null,
- "ipv4-oam-address": "10.10.99.11"
- }
-
-This payload would result in the generic-vnf with the vnf-id =
-cscf0001v having ipv4-oam-address set to "10.10.99.11" and
-regional-resource-zone having its value removed from the database.
-
-Note: PATCH is used only to update attributes on a single node that
-already exists in AAI. That means it is not applicable to lists of
-any type.
-
- * You do not manage relationships with PATCH. There is a
- relationship API for that.
-
- * You cannot include child objects in a PATCH payload, i.e., you
- cannot PATCH an l3-network's attributes as well as supply some
- subnet children or their attributes within the same PATCH payload.
- You can GET/overlay/PUT parent/child payloads or you can PUT or
- PATCH each object individually with separate REST API calls.
-
-Optional Query Parameters
--------------------------
-
-A **depth** query parameter is available allowing a query to stop after it
-has reached a certain point in the graph. This allows clients to
-minimize the data that is returned to them and make the queries more
-performant. A depth=0 will return information of the node referred to
-by the URI only without any information on the children.
-
-Example
-
-.. code::
-
- GET https://aai.onap:8443/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}?depth=0
-
-A **nodes-only** parameter is available allowing a query to only
-display the properties of the nodes being queried without any
-relationship information. This allows clients to minimize data that is
-returned to them and make the queries more performant.
-
-Example
-
-.. code::
-
- GET https://aai.onap:8443/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}?nodes-only
-
-These parameters may be used in combination with each other.
-
-Example
-
-.. code::
-
- GET https://aai.onap:8443/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}?depth=0&nodes-only
-
-Delete Scope and Edges
-----------------------
-
-An attempt to remove a node which would result in a delete scope being
-violated will return error 5.4.6110.
-
-The swagger documentation has been updated to show information about
-delete scope and edges.
-
-Here is a subset of the generic-vnf definition that will be used to
-demonstrate how the delete scope and edges are documented.
-
-The following table summarizes actions AAI will take upon deletion of a resource, i.e., its default delete scope:
-
-+-----------------------------+--------------------------------------------------------------------+
-| ERROR_IF_ANY_EDGES | If the resource being deleted has any edges at all |
-| | an error should be returned |
-+-----------------------------+--------------------------------------------------------------------+
-| ERROR_IF_ANY_IN_EDGES | If the resource being deleted has any edges that point IN towards |
-| | it, an error should be returned |
-+-----------------------------+--------------------------------------------------------------------+
-| THIS_NODE_ONLY | Delete the vertex being requested by first deleting its edge to |
-| | other vertices, but do not delete the other vertices. Note, the |
-| | delete will be rejected if the deletion target has DEPENDENT |
-| | children (e.g., tenants that have vservers) |
-+-----------------------------+--------------------------------------------------------------------+
-| CASCADE_TO_CHILDREN | Cascade the delete through vertices who have a parentOf |
-| | relationship to the vertex being deleted, as long as the vertex is |
-| | orphaned by the delete of its parent |
-+-----------------------------+--------------------------------------------------------------------+
-| ERROR_4_IN_EDGES_OR_CASCADE | Error if there are any in edges and, if not, cascade to |
-| | children |
-+-----------------------------+--------------------------------------------------------------------+
-
-Edge Documentation
-
-* Node A is the object being defined - e.g., generic-vnf
-
-* Node B is the XXX of OUT TO XXX
-
-* Direction is always Node A OUT TO Node B. Node A has requirement
- satisfied by Node B and the relationship is the edgelabel
-
-* Multiplicity is listed on the OUT TO edges
-
-* The former hasDelTarget is indicated by deletion statements that
- make it clear what gets deleted as a side effect of deleting
- something else.
-
-* The former isChild is indicated by full statements
-
-
-.. parsed-literal::
-
- *generic-vnf: object*
- *General purpose VNF*
-
- *Default Delete Scope*
-
- CASCADE_TO_CHILDREN
-
- * *OUT TO vnfc (org.onap.relationships.inventory.Uses, One2Many, delete of generic-vnf will delete vnfc)*
- * *IN FROM l-interface (l-interface child of generic-vnf)*
- * *IN FROM service-instance*
-
-Server Timeout
---------------
-
-A Server timeout is implemented for these APIs to make sure the server
-did not continue processing the request long after a client times out
-on their side. An error code ERR.5.4.7406 will be returned when this
-limit is hit. The default value for Resources API is 60 secs. The
-clients should set their timeouts accordingly.
-
-Bulk APIs
----------
-
-The Bulk API allows clients to make multiple requests in a single
-transaction. Please look for additional details on the following wiki
-page: `Bulk API <bulkApi.html>`_
-
-AAI Traversal APIs
-==================
-
-Not all queries of the graph are purely GETs of a specific resource
-and its related vertexes. The following capabilities are available to
-meet more advanced search needs. Please contact the AAI team if you
-need another search.
-
-Node Queries
-------------
-
-The Nodes Query mechanism was implemented in support of searching the
-pservers which do not have the ipv4-oam-ipaddress set. It will allow
-nodes to be searched based on certain properties of the nodes. It will
-allow search based on properties being set, not set or set to specific
-values.
-
-Generic Queries
----------------
-
-The Generic Query mechanism allows to search for certain nodes of
-“include” node types at a specified “depth” from the from a particular
-start node of type “start-node-type” identified by specifying its
-“key” values
-
-Model Based Query and Delete
-----------------------------
-
-AAI supports a search and delete capability that allows a client to
-retrieve or delete an instance of a service based on the model
-subgraph definition provided to AAI by ASDC.
-
-The instance filters must uniquely identify a service instance.
-
-The URL is as follows:
-
-.. code::
-
- https://{serverRoot}/aai/search/model[?action=DELETE]
-
-.. code-block:: json
-
- {
- "query-parameters": {
- "model": {
- "model-invariant-id": "$modelInvariantId",
- "model-vers": {
- "model-ver": [
- {
- "model-version-id": "$modelVersionId"
- }
- ]
- }
- },
- "instance-filters": {
- "instance-filter": [
- {
- "customer": {
- "global-customer-id": "$globalCustID"
- },
- "service-instance": {
- "resource-version": "$resourceversionID",
- "service-instance-id": "$serviceInstanceID"
- },
- "service-subscription": {
- "service-type": "$serviceType"
- }
- }
- ]
- }
- }
- }
-
-Named Query
------------
-
-These queries provide the ability to upload a json file describing the
-inputs and designed output based on traversing the graph in a
-particular way. Existing named queries are supported but will be
-migrated to custom queries. **Named queries will be deprecated (no new
-queries, just support for existing ones) in Dublin and clients will be
-asked to migrate to use the custom queries instead.**
-
-Custom Query
-------------
-
-This API provides AAI clients an API for complex data retrieval. To
-execute a custom query, a client will perform an HTTP PUT request on
-the query API and include a payload indicating the starting node and
-the query to be run. While the client is performing a PUT request,
-this is actually a data query and no data is created or changed.
-
-Assumptions
-~~~~~~~~~~~
-
-+----------+-----------------------------+--------------------------+
-| No. | Assumption | Approach |
-+==========+=============================+==========================+
-| 1 | Assume that client will | |
-| | not request large amounts | |
-| | of data from AAI w/out | |
-| | using secondary filters | |
-+----------+-----------------------------+--------------------------+
-
-Depdendencies
-~~~~~~~~~~~~~
-
-Data has been PUT to AAI prior to the query.
-
-Custom Query URI
-~~~~~~~~~~~~~~~~
-
-.. code::
-
- PUT /aai/v$/query?format={format}
-
-Query Formats
-~~~~~~~~~~~~~
-
-The format determines what information is returned from the
-query. Acceptable formats are: count, id, pathed, resource,
-resource_and_url, or simple.
-
-count
-^^^^^
-
-Provides an count of the objects returned in the query.
-
-.. code::
-
- PUT /aai/v$/query?format=count
-
-Example reponse
-
-.. code-block:: json
-
- {
- "results": [
- {
- "pnf": 4,
- "p-interface": 5,
- "l-interface": 3,
- "pserver": 1
- }
- ]
- }
-
-id
-^^^
-
-Provides an array of objects containing resource-type (AAI's node
-type; i.e., pnf) and a URI using the vertex ID from AAI's graph.
-
-.. code::
-
- PUT /aai/v$/query?format=id
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "resource-type": "complex",
- "resource-link": "/aai/v1/resources/id/8159312"
- },
- {
- "resource-type": "complex",
- "resource-link": "/aai/v1/resources/id/389256"
- }
- ]
- }
-
-pathed
-^^^^^^
-
-Provides an array of objects containing resource-type (AAIs node type;
-i.e., pnf) and a URI using the AAI REST API pathed URIs
-
-.. code::
-
- PUT /aai/v$/query?format=pathed
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "resource-type": "complex",
- "resource-link": "/aai/v1/cloud-infrastructure/complexes/complex/complex1"
- },
- {
- "resource-type": "complex",
- "resource-link": "/aai/v1/cloud-infrastructure/complexes/complex/complex1"
- }
- ]
- }
-
-resource
-^^^^^^^^
-
-Provides each object in the results array in the same format as AAI's
-REST API with depth = 1 (first level children and cousin
-relationships).
-
-.. code::
-
- PUT /aai/v$/query?format=resource
-
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "complex": {
- "city": "Anywhere",
- "complex-name": "complex-mccomplexface",
- "country": "USA",
- "data-center-code": "CHG",
- "latitude": "30.123456",
- "longitude": "-78.135344",
- "physical-location-id": "complextest1",
- "physical-location-type": "lab",
- "postal-code": "90210",
- "region": "West",
- "relationship-list": {
- "relationship": [
- {
- "related-link": "/aai/v1/network/zones/zone/zone1",
- "related-to": "zone",
- "related-to-property": [
- {
- "property-key": "zone.zone-name",
- "property-value": "zone-name1"
- }
- ],
- "relationship-data": [
- {
- "relationship-key": "zone.zone-id",
- "relationship-value": "zone1"
- }
- ],
- "relationship-label": "org.onap.relationships.inventory.LocatedIn"
- },
- {
- "related-link": "/aai/v1/cloud-infrastructure/cloud-regions/cloud-region/Cloud-Region/Region1",
- "related-to": "cloud-region",
- "related-to-property": [
- {
- "property-key": "cloud-region.owner-defined-type"
- }
- ],
- "relationship-data": [
- {
- "relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "Cloud-Region"
- },
- {
- "relationship-key": "cloud-region.cloud-region-id",
- "relationship-value": "Region1"
- }
- ],
- "relationship-label": "org.onap.relationships.inventory.LocatedIn"
- }
- ]
- },
- "resource-version": "1531233769164",
- "state": "CA",
- "street1": "100 Main St",
- "street2": "C3-3W03"
- }
- }
- ]
- }
-
-resource_and_uri
-^^^^^^^^^^^^^^^^
-
-Provides each object in the results array in the same format as AAI’s
-REST API with depth = 1 (first level children and cousin
-relationships) plus the pathed url for the result object in AAI.
-
-.. code::
-
- PUT /aai/v$/query?format=resource_and_url
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "complex": {
- "city": "Anywhere",
- "complex-name": "complex-mccomplexface",
- "country": "USA",
- "data-center-code": "CHG",
- "latitude": "30.123456",
- "longitude": "-78.135344",
- "physical-location-id": "complextest1",
- "physical-location-type": "lab",
- "postal-code": "90210",
- "region": "West",
- "relationship-list": {
- "relationship": [
- {
- "related-link": "/aai/v1/network/zones/zone/zone1",
- "related-to": "zone",
- "related-to-property": [
- {
- "property-key": "zone.zone-name",
- "property-value": "zone-name1"
- }
- ],
- "relationship-data": [
- {
- "relationship-key": "zone.zone-id",
- "relationship-value": "zone1"
- }
- ],
- "relationship-label": "org.onap.relationships.inventory.LocatedIn"
- },
- {
- "related-link": "/aai/v1/cloud-infrastructure/cloud-regions/cloud-region/Cloud-Region/Region1",
- "related-to": "cloud-region",
- "related-to-property": [
- {
- "property-key": "cloud-region.owner-defined-type"
- }
- ],
- "relationship-data": [
- {
- "relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "Cloud-REgion"
- },
- {
- "relationship-key": "cloud-region.cloud-region-id",
- "relationship-value": "Region1"
- }
- ],
- "relationship-label": "org.onap.relationships.inventory.LocatedIn"
- }
- ]
- },
- "resource-version": "1531233769164",
- "state": "CA",
- "street1": "100 Main St",
- "street2": "C3-3W03"
- },
- "url": "/aai/v11/cloud-infrastructure/complexes/complex/complextest1"
- }
- ]
- }
-
-simple
-^^^^^^
-
-Provides each result object in a simplified format. The node-type,
-graph vertex id, pathed url, object properties, and directly related
-objects in the graph are all returned. Both direct parent/child
-objects and cousin objects are included in the related-to array.
-
-.. code::
-
- PUT /aai/v$/query?format=simple
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "id": "81924184",
- "node-type": "complex",
- "properties": {
- "city": "Anywhere",
- "complex-name": "complex-mccomplexface",
- "country": "USA",
- "data-center-code": "CHG",
- "latitude": "30.123456",
- "longitude": "-78.135344",
- "physical-location-id": "complextest1",
- "physical-location-type": "lab",
- "postal-code": "90210",
- "region": "West",
- "resource-version": "1531233769164",
- "state": "CA",
- "street1": "100 Main St",
- "street2": "C3-3W03"
- },
- "related-to": [
- {
- "id": "40968400",
- "node-type": "zone",
- "relationship-label": "org.onap.relationships.inventory.LocatedIn",
- "url": "/aai/v1/network/zones/zone/zone1"
- },
- {
- "id": "122884184",
- "node-type": "cloud-region",
- "relationship-label": "org.onap.relationships.inventory.LocatedIn",
- "url": "/aai/v1/cloud-infrastructure/cloud-regions/cloud-region/Cloud-Region/Region1"
- },
- {
- "id": "122884296",
- "node-type": "rack",
- "relationship-label": "org.onap.relationships.inventory.LocatedIn",
- "url": "/aai/v1/cloud-infrastructure/complexes/complex/complextest1/racks/rack/rackname1-1test"
- }
- ],
- "url": "/aai/v1/cloud-infrastructure/complexes/complex/complextest1"
- }
- ]
- }
-
-graphson
-^^^^^^^^
-
-Provides the results using the graphson standard.
-
-.. code::
-
- PUT /aai/v$/query?format=graphson
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "id": 81924184,
- "inE": {
- "org.onap.relationships.inventory.LocatedIn": [
- {
- "id": "oeioq-oe3f4-74l-1crx3s",
- "outV": 40968400,
- "properties": {
- "aai-uuid": "9e75af3d-aa7f-4e8e-a7eb-32d8096f03cc",
- "contains-other-v": "NONE",
- "delete-other-v": "NONE",
- "prevent-delete": "IN",
- "private": false
- }
- },
- {
- "id": "216a6j-215u1k-74l-1crx3s",
- "outV": 122884184,
- "properties": {
- "aai-uuid": "4b3693be-b399-4355-8747-4ea2bb298dff",
- "contains-other-v": "NONE",
- "delete-other-v": "NONE",
- "prevent-delete": "IN",
- "private": false
- }
- },
- {
- "id": "215xjt-215u4o-74l-1crx3s",
- "outV": 122884296,
- "properties": {
- "aai-uuid": "958b8e10-6c42-4145-9cc1-76f50bb3e513",
- "contains-other-v": "IN",
- "delete-other-v": "IN",
- "prevent-delete": "NONE",
- "private": false
- }
- }
- ]
- },
- "label": "vertex",
- "properties": {
- "aai-created-ts": [
- {
- "id": "1crvgr-1crx3s-6bk5",
- "value": 1531231973518
- }
- ],
- "aai-last-mod-ts": [
- {
- "id": "215vkb-1crx3s-6dxh",
- "value": 1531233769164
- }
- ],
- "aai-node-type": [
- {
- "id": "215urv-1crx3s-69z9",
- "value": "complex"
- }
- ],
- "aai-uri": [
- {
- "id": "1crxfv-1crx3s-6gat",
- "value": "/cloud-infrastructure/complexes/complex/complextest1"
- }
- ],
- "aai-uuid": [
- {
- "id": "1crvuz-1crx3s-1ybp",
- "value": "3959ceca-3a89-4e92-a2ff-073b6f409303"
- }
- ],
- "city": [
- {
- "id": "1cs0zv-1crx3s-4irp",
- "value": "Beverley Hills"
- }
- ],
- "complex-name": [
- {
- "id": "215wcr-1crx3s-4d8l",
- "value": "chcil"
- }
- ],
- "country": [
- {
- "id": "1cs26j-1crx3s-4l51",
- "value": "USA"
- }
- ],
- "data-center-code": [
- {
- "id": "215ssr-1crx3s-4bnp",
- "value": "CHG"
- }
- ],
- "last-mod-source-of-truth": [
- {
- "id": "215vyj-1crx3s-696t",
- "value": "aai-AppId"
- }
- ],
- "latitude": [
- {
- "id": "1cs2yz-1crx3s-4mpx",
- "value": "30.123456"
- }
- ],
- "longitude": [
- {
- "id": "1cs3d7-1crx3s-4nid",
- "value": "-174.135344"
- }
- ],
- "physical-location-id": [
- {
- "id": "1crzez-1crx3s-4a2t",
- "value": "complextest1"
- }
- ],
- "physical-location-type": [
- {
- "id": "1crzt7-1crx3s-4ged",
- "value": "lab"
- }
- ],
- "postal-code": [
- {
- "id": "1cs1sb-1crx3s-4kcl",
- "value": "90210"
- }
- ],
- "region": [
- {
- "id": "1cs2kr-1crx3s-4lxh",
- "value": "West"
- }
- ],
- "resource-version": [
- {
- "id": "215v63-1crx3s-glh",
- "value": "1531233769164"
- }
- ],
- "source-of-truth": [
- {
- "id": "1crv2j-1crx3s-6epx",
- "value": "foo"
- }
- ],
- "state": [
- {
- "id": "1cs1e3-1crx3s-4jk5",
- "value": "CA"
- }
- ],
- "street1": [
- {
- "id": "1cs07f-1crx3s-4h6t",
- "value": "100 Main St"
- }
- ],
- "street2": [
- {
- "id": "1cs0ln-1crx3s-4hz9",
- "value": "Room 101"
- }
- ]
- }
- }
- ]
- }
-
-
-Optional Query Parameters
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-depth
-^^^^^
-
-You can pass the depth query parameter to specify how many levels of
-children/grandchildren to return. The default depth is 1.
-
-.. code::
-
- PUT /aai/v$/query?format={}&depth=0
-
-nodesOnly
-^^^^^^^^^
-
-You can pass the nodesOnly query parameter to have the output only
-contain the object properties with no relationships.
-
-.. code::
-
- PUT /aai/v$/query?format={format}&nodesOnly=true
-
-subgraph
-^^^^^^^^
-
-You can pass a subgraph query parameter that determines the behavior
-of the output. Using subgraph=prune returns all of the objects from
-the query and only the edges between those objects. Using
-subgraph=star returns all of the objects from the query plus all of
-the objects they relate to.
-
-The default is subgraph=star
-
-.. code::
-
- PUT /aai/v$/query?format={format}&subgraph={subgraph}
-
-HTTP Headers
-~~~~~~~~~~~~
-
-+--------------------------+--------------------------------------------------------------------------------------+
-| X-FromAppID={client ID}| Unique application identifier. |
-+--------------------------+--------------------------------------------------------------------------------------+
-| X-TransactionID={UUDID} | must be a UUID and unique to each transaction within the context of an X-FromAppID. |
-+--------------------------+--------------------------------------------------------------------------------------+
-| Content-Type={format} | format of the request. Should be application/json or application/xml. |
-+--------------------------+--------------------------------------------------------------------------------------+
-| Accept={format} | format of the response. Should be application/json or application/xml. |
-+--------------------------+--------------------------------------------------------------------------------------+
-
-Request Payload
-~~~~~~~~~~~~~~~
-
-Typically the query payload will include both a "start" and a "query"
-portion. The "start" can indicate one or more starting nodes in the
-graph. If multiple nodes are specified, the result will contain the
-query results for all of the start nodes. The "query" indicates the
-name of the query to be run and also takes query parameters depending
-on the query. Please reference the queries on the AAI wiki for
-specific saved queries and how they should be usServer Timeout A
-Server timeout is implemented for these APIs to make sure the server
-did not continue processing the request long after a client times out
-on their side. An error code ERR.5.4.7406 will be returned when this
-limit is hit. The default value for Traversal API is 60 secs. The
-clients should set their timeouts accordingly.
-
-List of Queries and Payloads
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-For a full list of available custom queries, please refer to our
-`Custom Queries <customQueries.html>`_ document
-
-Nodes Query
------------
-
-In working with AAI's standard REST API, you may have noticed that
-certain API paths have a hierarchy to them and require a client to
-know multiple object keys to preform GETs. The nodes API allows for
-more freedom in querying AAI, allowing clients to circumvent the need
-to know every key in the hierarchy.
-
-See `Nodes Query <nodesQuery.html>`_ for more information.
diff --git a/docs/AAI REST API Documentation/AAIRESTAPI_DUBLIN.rst b/docs/AAI REST API Documentation/AAIRESTAPI_DUBLIN.rst
deleted file mode 100644
index 04cd6c08..00000000
--- a/docs/AAI REST API Documentation/AAIRESTAPI_DUBLIN.rst
+++ /dev/null
@@ -1,1777 +0,0 @@
-.. contents::
- :depth: 3
-..
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-
-\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
-
-==============
- AAI REST API
-==============
-
-Overview
-========
-
-The A&AI REST API provides access to the A&AI active inventory graph.
-The API is largely configured off of models and configuration files.
-Each vertex in the graph has an API that can be called separately or,
-if part of a tree structure, as a nested element with one or more
-generations (parent, grandparent, etc.).
-
-The edges of the graph are provisioned using a relationship list
-construct. For PUT methods, a relationship contains the vertex type
-or category (related-to) and a URI that provides the identity of the
-resource within A&AI. The URI can be used with the server root to
-call A&AI to get more details of the related resource but cannot be
-cached for long periods. (e.g., the version of the URI may get
-deprecated when the release changes).
-
-The REST API describes each API that A&AI provides, independent of the
-caller of the API, therefore there is no information to be found here
-regarding the expectations on the callers. That information is
-conveyed in AID documents for each client. AIDs will describe the
-information expected from specific clients, but may not contain the
-full payloads that would be needed on an update. Please see the
-concurrency notes referenced below in order to do the right kind of
-PUTs (GET, replace just what you are changing, PUT) or use the PATCH
-capability.
-
-Deprecation Warnings and History
-================================
-
-AAI will maintain backwards compatibility for three prior releases.
-This means, with the introduction of v14 AAI will support **v11**
-(Amsterdam), **v13** (Beijing), **v14** (Casablanca), and **v16** (Dublin)
-
-Dublin (v16)
-------------
-
-Clients can call the REST API with any valid path ending in /relationship-list to retrieve just the relationship-list for that object.
-
-For example:
- - /network/generic-vnfs/generic-vnf/{vnf-id}/relationship-list
- returns just the relationship-list of relationships for that generic-vnf
- - /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-name}/relationship-list
- returns just the relationship-list of relationships for that vserver
-
-Custom Queries for replacing named queries are now available for clients to switch to.
-
-Casablanca (v14)
-----------------
-
-- A new API called recents API is now available mostly intended for DCAE use.
-
-- A new and improved bulk api interface is also available now.
-
-- More details on the above APIs can be found in wiki pages referenced
- in sections below.
-
-Beijing (v13)
--------------
-
-- To handle security vulnerabilities that were raised as part of Nexus
- IQ scans in ONAP, the APIs are being hosted on a spring-boot with
- Jetty web container.
-
-- The deletion rules are now applied to all the nodes that will be
- deleted by the delete request.
-
- For example, if the graph is:
-
- +------+----------+
- |nodeA | nodeD |
- +------+----------+
-
- If nodeA is parent of nodeB and nodeB is parent of nodeC
-
- +------+---------------------+
- |nodeA | CASCADE_TO_CHILDREN |
- +------+---------------------+
- |nodeB | CASCADE_TO_CHILDREN |
- +------+---------------------+
- |nodeC | ERROR_IF_IN_EDGES |
- +------+---------------------+
-
-- If request is to delete nodeA, it would fail because nodeC has an in
- edge from a node not being deleted in this transaction.
-
-- A configurable server timeout was implemented to make sure the AAI
- server did not continue processing the request long after a client
- times out on their side. An error code ERR.5.4.7406 will be returned
- when this limit is hit. A configuration for clients known to have
- longer running queries currently overrides the default value.
-
-- To handle a risk identified by Fortify scans, a maxOccurs of 5000
- was added to the XSD.
-
-API changes
-~~~~~~~~~~~
-
-- DELETE request will generate a DMAAP event for each node deleted
- (not just the for which the DELETE request was made)
-
-- Relationship list
-
- Starting with Casablanca, multiple edges can exist
- in the graph between the same 2 nodes. The REST API has been
- enhanced via changing the relationship-list so clients can specify
- which edge they are creating and differentiate multiple edges
- between the same 2 nodes. Backwards compatibility with older API
- versions that do notspecify the edge will be maintained.
-
-- A new property “relationship-label” has been added that when
- specified will be used to create any new edge. If not specified the
- default edge label between the two nodes will be used. The
- relationship-label will always be returned with the v12 version of
- GETs whenever the relationship-list is returned.
-
-.. code-block:: json
-
- {
- "relationship-list": {
- "relationship": [
- {
- "related-link": "/aai/v12/cloud-infrastructure/complexes/complex/6d8f945d-8bd2-4fa2-ad37-36b21fc8fb23-PS2418",
- "related-to": "complex",
- "relationship-data": [
- {
- "relationship-key": "complex.physical-location-id",
- "relationship-value": "6d8f945d-8bd2-4fa2-ad37-36b21fc8fb23-PS2418"
- }
- ],
- "relationship-label": "locatedIn"
- }
- ]
- }
- }
-
-Amsterdam (v11)
----------------
-
-API retirements:
-
-- The actions/update API will be retired. Clients must switch to PATCH.
- There is one grandfathered usage for vpe update flows which will be
- retired in v11.
-
-- The edge tag query will be retired.
-
-Notable attribute and/or valid value changes (generally also impacts
-events):
-
-- The persona-model-id and persona-version will be replaced with
- model-invariant-id (same value as persona-model-id) and
- model-version-id (the UUID of the specific version of a model).
- Persona-model-customization-id will be replaced by
- model-customization-id.
-
-- The operational-state attribute will be replaced by
- operational-status and the only valid values will be in-service-path
- and out-of-service-path
-
-- The vpn-binding object will be split in two to reflect more than one
- route-target per binding. The route-target will be a child of
- vpn-binding and some attributes will move from vpn-binding to
- route-target.
-
-- The following license related attributes will be removed from
- generic-vnf: license-key, entitlement-assignment-group-uuid,
- entitlement-resource-uuid, license-assignment-group-uuid, and
- license-key-uuid due to the introduction of the entitlement and
- license children.
-
-Event Specific:
-
-- Normal impacts due to renaming or adding attributes, splitting
- objects, etc. Please see swagger documentation for objects of
- interest.
-
-- In v11, clients that require lineage, children, or relationship
- information need to subscribe to a different DMaaP topic than the
- current one.
-
-Relationship List
-
-- The related-link will be a URI and thus not contain
- https://{serverroot} (impacts events)
-
-- The related-link will be used on a PUT as the "first choice" to
- identify the related resource. The relationship-data structure, which
- contains the unordered set of keys, is still an acceptable way to
- relate two objects but, *if both the relationship-data and the
- related-link are passed, and they don't agree, the related-link will
- be used without warning that the data is inconsistent*.
-
-- The relationship-data will be ignored on PUT.
-
-Future Warning
-==============
-
-In the future, the hope is that individual node definitions will be
-separately versioned from API behavior and from one another (e.g.,
-vserver hasn't changed in many releases and so doesn't need to have
-its "definition" version updated).
-
-Because relationships are starting to become more complex, it may be
-necessary for AAI to expose to clients the exact relationship between
-two nodes. This will likely be done with a relationship-type
-attribute of relationships in the relationship-list.
-
-To support the concept of events getting generated on specific changed
-items, AAI will be migrating towards a model of asking clients to do
-the most granular PUTs possible rather than leveraging the nested
-elements of a tree structure.
-
-The vce, port-group, cvlan-tag, newvce, vpe, oam-network, and
-dvs-switch objects will eventually be deprecated in favor of
-generic-vnf, l3-network, ctag-assignment, segmentation-assignment, and
-TBD.
-
-L3-network will eventually be replaced by virtual-network.
-
-How to Use this Document
-========================
-
-The only attributes in our objects that are declared required are
-those which we know will be present at the creation of each object and
-which are needed to support the construction of the AAI Graph. This
-does not imply that one of AAI's clients doesn't need data.
-
-When you click on the API documentation, you will see the Summary of
-APIs broken down by namespace (e.g., cloud-infrastructure, business,
-network, service-design-and-creation). You can search for **Tag:**
-(matching the explicit case) to move from namespace to namespace through
-the Summary.
-
-Search for **Paths** to skip past the Summary section where there will
-be more detail about each API. Query parameters are provided here, as
-well as links to our error codes.
-
-Search for **Schema definitions** to see the definitions of the
-payloads. In your browser URL, you can type /#/definitions/node-name at
-the end of the html address to skip directly to a payload definition.
-
-Note that the schema definitions now contain information about the
-delete scope of a node, edges, and some related node information.
-Given this information can now be generated, it is no longer repeated
-in this document.
-
-Once AAI has a model and configured it, the AAI development server can
-be used to generate sample XML and JSON payloads, according to the
-Accept header passed in the request. This is done by calling the
-"plural" version of an API followed by the word example (e.g.,
-/vserver/vservers/example). This returns a GET result array with one
-entry. That single entry can be sent in a PUT request with actual data
-(the resource-id does not need to be in the PUT payload as it is on the
-URL).
-
-Finally, custom queries that are not simple GETs of a resource must be
-identified to AAI as separate user stories. This includes searching
-for a resource with other attributes on the same resource, as well as
-searching for resources based on their relationship with other
-objects.
-
-AAI API Definition
-==================
-
-Namespaces
-----------
-
-Cloud Infrastructure Domain
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The Cloud Infrastructure domain (cloud-infrastructure) represents the
-assets managed within a cloud site. This includes the complex, the
-physical servers, the availability zones, oam-networks, tenants, and
-vserver-related resources (vservers, flavors, images, etc.).
-
-Tenants, oam-networks, availability-zones, volume-groups, images,
-flavors, and dvs-switches will have cloud-region as its parent node.
-
-Network Domain
-~~~~~~~~~~~~~~
-
-The network namespace contains virtual and physical network resources
-as well as connection resources such as physical links, logical links,
-lag links, etc.
-
-The vce/port-group/cvlan-tag tree represents an immature model that
-blended several resources together in ways that were expedient but
-which need to be re-evaluated. A newvce object exists which was the
-basis of the generic-vnf object. Future efforts will attempt to
-migrate vce and vpe into generic-vnf.
-
-Business Domain
-~~~~~~~~~~~~~~~
-
-The business namespace captures customers, service-subscriptions, and
-service-instances. This domain is immature and will be evolving as
-service design and creation starts to gel.
-
-Customers and service-subscriptions in particular will be evolving
-soon. Any service that is customer facing will see customer and
-service-subscription data offboarding to BSSs. The
-service-instance-id will be the "join point" within the BSS to
-correlate the service-instance to the product and customer. Services
-that are for infrastructure purposes will have a new entity, an
-owning-entity, to replace the customer. The owning-entity will be
-related to the SDC service models that use it.
-
-Service Design and Creation
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The service design and creation namespace captures data we invented
-based on what we thought SDC would eventually provide. The structure
-of that data is definitely not what the current plans are for SDC
-however we need to at least capture the spirit of what's intended and
-communicate that across ONAP sub components that need it.
-
-To date, there are only five containers:
-
-1. Service-capabilities capture the pairings of service to
- resources. At the time of construction, the only data we had to
- denote service was the service-type from SO. The vnf-type is the
- resource.
-
-2. Service captures the service model instances and this will be
- deprecated in the future as things mature
-
-3. Vnf-image captures information about the resource image needed for
- a VNF. This was created due to there being no info available on
- the vservers that run on uCPE
-
-4. Models captures model definitions (subgraph definitions using the
- AAI widgets)
-
-5. named-queries capture subgraph definitions that allow different
- data to be retrieved for a given type of asset
-
-Security
---------
-
-All REST APIs must be called using https.
-
-HTTPS Basic Authentication will be used to authenticate clients. The
-remote user from the HTTP Servlet Request is used against an AAI
-policy to see if the authenticated user is authorized for the resource
-and actions being request.
-
-Client should use credentials provided to their system via AAF.
-
-Headers
--------
-
-The following will be used for logging and interface diagnostic purposes.
-
- * X-FromAppId Unique Application ID assigned to the user of these APIs
- * X-TransactionId Unique ID that identifies an API request
-
-The X-FromAppId will be assigned to each application by the AAI team.
-The X-TransactionId must be unique to each transaction within the
-context of an X-FromAppId.
-
-SO, SDN-C, and AAI have agreed to use the Java UUID class to generate
-unique ids for X-TransactionId.
-
-The Accept and Content-type header should be set to either
-application/json or application/xml except as documented for PATCH.
-
-Response Codes and Error Handling
----------------------------------
-
-AAI will use the following HTTP codes
-
-HTTP Codes:
-~~~~~~~~~~~
-
-- 200 – Success
-- 201 – Created
-- 202 - Accepted
-- 204 – Success, no payload returned
-- 400 - Bad Request
-- 401 - Unauthorized
-- 403 - Forbidden
-- 404 - Not Found
-- 405 – Method Not Allowed
-- 409 - The request could not be completed due to a conflict with the
- current state of the target resource. This code is used in situations
- where the user might be able to resolve the conflict and resubmit the
- request. If the resource version doesn’t match AAI or a required
- resource version isn't sent but should have been
-- 410 - You are using a version of the API that has been retired
-- 412 – Precondition failed (If the resource version doesn’t match AAI or arequired resource version isn't sent but should have been
-- 415 – Unsupported Media Type
-- 500 - Internal Server Error
-
-Successful PUT responses shall return the following codes:
- * 200 (OK): used when an existing resource has been modified and
- there is a response buffer
- * 201 (Created): MUST be used when a new resource is created
- * 202 (Accepted): used when AAI completed the action requested but
- may have taken other actions as well, which are returned in the
- response payload
- * 204 (No Content): used when the existing resource has been modified
- and there is no response buffer
-
-Successful DELETE responses shall return the following codes:
- * 200 (OK): for a successful response if the response includes an
- entity describing the status.
- * 204 (No Content): if the action has been enacted but the response
- does not include an entity.
-
-Successful GET responses shall return the following codes:
- * 200 (OK): for a successful response for a resource that has been found
- * 404 (Not Found) for a successful response retrieving a list of
- items and there were no items found, i.e., the GET of the specific
- plural resource was not found
- * 404 (Not Found): when a specific resource was not found
-
-Failures:
- * 400 Bad Request will be returned if headers are missing
- * 404 Not Found will be returned if an unknown URL is used
-
-In addition, the standard response buffer will be structured as follows unless otherwise specified.
-There are two types of requestErrors.
-
- * Service Exceptions – These exceptions occur when a service is
- unable to process a request and retrying the request will result in
- a consistent failure (e.g., an application provides invalid input).
- * Policy Exceptions – These exceptions occur when a policy criteria
- has not been met (e.g., the (N+1)th request arrives when an
- application’s service level agreement only allows N transactions
- per time interval).
-
-Italics are specific to the error returned, and generally described in the notes
-
-.. parsed-literal::
-
- HTTP/1.1 405 *Method Not Allowed*
- Content-Type: application/json
- Content-Length: nnnnn
- Date: *Thu, 04 Jun 2009 02:51:59 GMT*
- {
- “requestError”:{
- “policyException”:{
- “messageId”:"*POL8007*",
- “text”:”*The resource was invoked with an unsupported operation: %1.*”,
- “variables”: [”*PUT*”]
- }
- }
-
-Notes:
-
-a. On the first line, substitute the appropriate status response code.
-
-b. On the second line, substitute the appropriate content type.
-
-c. Express the requestError structure in the required content type (e.g., either JSON or XML). AAI will use JSON.
-
-d. ‘requestError’ contains either a ‘policyException’ or a ‘serviceException’ structure.
-
-e. url is optional
-
-In 1512, AAI is introducing a response payload that is possible during a successful PUT. This payload is used to inform the client that, while AAI completed the action requested, the result could be interpreted as a warning or request for additional action, as negotiated with the client.
-
-Sample response to a vserver PUT where the pserver and complex did not exist:
-
-.. code-block:: json
-
- {"responseMessages": {"responseMessage": [
- {
- "messageId": "INF0003",
- "text": "Success with additional info performing %1 on %2. Added %3 with key %4 (msg=%5) (rc=%6)",
- "variables": {"variable": [
- "PUTvserver",
- "ccwvm388",
- "complex",
- "physical-location-id=fakeccwcomplex",
- "Added prerequisite object to db:complex",
- "0.3.0004"
- ]}
- },
- {
- "messageId": "INF0003",
- "text": "Success with additional info performing %1 on %2. Added %3 with key %4 (msg=%5) (rc=%6)",
- "variables": {"variable": [
- "PUTvserver",
- "ccwvm388",
- "pserver",
- "hostname=fakeccwpserver",
- "Added prerequisite object to db:pserver",
- "0.3.0004"
- ]}
- }
- ]}}
-
-Referential Integrity
----------------------
-
-AAI is primarily a view to the relationships between instances of
-services, physical and virtual components, etc. It stores just the
-details it needs to be efficient to its tasks and knows how to get
-more details if needed.
-
-As such, a transaction sent to AAI may be refused if would break
-referential integrity. The referential integrity rules of AAI are
-still evolving as we understand the services and customers that will
-use us.
-
-AAI uses a graph database on a NoSQL data store. The following are
-true for AAI:
-
-* Some vertices are exposed to the outside world through APIs, others
- are internal to how we store the data (i.e., it may look like one
- resource to our customers but it is expressed as more than one
- vertex in our graph)
-
-* Vertices that are internal to AAI will be deleted when the parent
- vertex is deleted, if deletion of the parent leaves the child vertex
- orphaned
-
-* Vertices that are exposed need to be managed using specific rules
- for each vertex.
-
-* Vertices may have more than just parent/child relationships. One
- example is a vserver, which will be owned by a tenant and used by a
- VNF.
-
-
-URLs Sent To and Retrieved From A&AI
-------------------------------------
-
-A&AI receives URLs from clients that point back to that client in
-order to get more details about the data sent to A&AI. A&AI expects
-the URLs sent by clients (e.g., self links) to be URL encoded
-(UTF-8) and A&AI will store them unchanged.
-
-URIs that A&AI constructs that point to A&AI resources will be
-returned URLEncoded (UTF-8) to clients. This affects URIs in
-relationship lists and search results. Note that A&AI used to send
-URLs but, as reported in the 1707 impacts, these will now be URIs.
-
-A&AI expects space to be %20, and not plus(+).
-
-The Relationship-List
----------------------
-
-The REST interface does not lend itself to creating more than
-parent-child relationships and the backend structure of AAI is a
-graph. A goal of AAI, and shared with ONAP, is to do as little coding
-as possible to introduce a new service into the service design and
-creation environment.
-
-To that end, we've introduced a relationship-list structure. AAI will
-ask its clients to provide certain data in the relationship-list
-structure.
-
-Each relationship has a related-to attribute and a list of key/value
-pairs. The related-to attribute identifies the node type that the
-resource being acted on is to be related to using the data in the
-key/value pairs. AAI will encode a set of rules for each resource
-type to verify that only valid edges are being made. AAI will keep
-the directionality and cardinality, and the edge attributes within its
-own logic. In the near future, the definition of relationships, their
-validity, and cardinality will be captured in the ONAP TOSCA models.
-
-AAI also has a concept of a related-to category. To date, the only
-category is vnf. The vnf category is used as the related-to value to
-indicate that the relationship being establish is to a Virtual Network
-Function of unknown type. The vnf-id happens to be unique for all
-services across all nodes in the graph. By providing vnf.vnf-id with
-a specific value, AAI can look at all VNFs in the graph and find the
-appropriate vertex. Note that this only applies to PUTs.
-
-Category vnf is used for node types of vce, vpe, and generic-vnf.
-
-If an attempt is made to add a relationship to a node that doesn't
-exist (e.g., from a vserver to a vnf, and the vnf doesn't exist), a
-unique message Id (3003) will be returned with a specific error code
-(ERR.5.4.6129). Arguments will tell the client which node type was
-missing (e.g., vnf) and the key data for that node type (vnf.vnf-id).
-
-Single relationships can be PUT to the graph in the following way:
-
-.. code::
-
- https://{serverRoot}/{namespace}/{resource}/relationship-list/relationship
-
-or
-
-.. code::
-
- https://aai.onap:8443/aai/v16/cloud-infrastructure/pservers/pserver/pserver-123456789-01/p-interfaces/p-interface/p-interface-name-123456789-01/l-interfaces/l-interface/l-interface-name-123456789-01/relationship-list/relationship
-
-with a payload containing the relationship information.
-
-AAI will accept and give preference to the related-link URI
-
-XML
-
-.. code-block:: xml
-
- <relationship xmlns="http://org.onap.aai.inventory/vX">
- <related-link>*/aai/v16/network/logical-links/logical-link/logical-link-123456789-01*</related-link>
- <related-to>logical-link</related-to>
- <relationship-data>
- <relationship-key>logical-link.link-name</relationship-key>
- <relationship-value>logical-link-123456789-01</relationship-value>
- </relationship-data>
- </relationship>
-
-JSON
-
-.. code-block:: json
-
- {
- "related-link": " /aai/v16/network/logical-links/logical-link/logical-link-123456789-01",
- "related-to": "logical-link",
- "relationship-data": [
- {
- "relationship-key": "logical-link.link-name",
- "relationship-value": " logical-link-123456789-01"
- }
- ]
- }
-
-Health Check API
-----------------
-
-The util domain is where AAI locates utility functions. There is
-currently one utility function, echo, which serves as a ping test that
-authenticated authorized clients can call to ensure there is
-connectivity with AAI.
-
-The URL for the echo utility is:
-
-.. code::
-
- https://aai.onap:8443/aai/util/echo
-
-If the response is unsuccessful, an error will be returned following
-the standard format.
-
-The successful payload returns the X-FromAppId and X-TransactionId
-sent by the client.
-
-Successful XML Response Payload
--------------------------------
-
-.. code-block:: xml
-
- <Info>
- <responseMessages>
- <responseMessage>
- <messageId>INF0001</messageId>
- <text>Success X-FromAppId=%1 X-TransactionId=%2 (msg=%3) (rc=%4)</text>
- <variables>
- <variable>CCW</variable>
- <variable>CCW33335</variable>
- <variable>Successful health check:OK</variable>
- <variable>0.0.0002</variable>
- </variables>
- </responseMessage>
- </responseMessages>
- </Info>
-
-Successful JSON Response Payload
---------------------------------
-
-.. code-block:: json
-
- {
- "responseMessages": {
- "responseMessage": [
- {
- "messageId": "INF0001",
- "text": "Success X-FromAppId=%1 X-TransactionId=%2 (msg=%3) (rc=%4)",
- "variables": {
- "variable": [
- "CCW",
- "CCW33335",
- "Successful health check:OK",
- "0.0.0002"
- ]
- }
- }
- ]
- }
- }
-
-AAI Resources CRUD APIs
-=======================
-
-The API structure is composed of:
-
- * The HTTP command, which indicates the operation to perform
- * The HTTP URI, which defines what object this operation is related to
- * The HTTP version, which MUST be 1.1
-
-Available HTTP commands are:
-
- * PUT: used to create or update an object
- * DELETE: used to delete an object or a set of objects
- * GET : used to query an object or set of objects
- * PATCH : used to update specific fields owned by the client doing the update
-
-The HTTP URI is built according to this pattern:
-
-.. code::
-
- https://{serverRoot}/{namespace}/{resource}
-
-* {serverRoot} refers to the server base url: hostname+port+base path+version. Port and base path are OPTIONAL but AAI will use port 8443 and base path aai. Note that the base path may change before production, so please make this configurable. Versions will change as releases are made.
-
-* {namespace} refers to the API namespace. Supported namespaces are cloud-infrastructure, business, service-design-and-creation, and network
-
-* {resource} refers to how the object is identified according to the namespace specifications.
-
-Example GET Request
-
-.. code::
-
- GET https://aai.onap:8443/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}
-
-Swagger and XSD:
-----------------
-
-`Offered APIs <../platform/offeredapis.html>`_
-
-Data Assumptions
-----------------
-
-Given AAI is largely a correlation engine among disparate inventory
-types, AAI will for the most part accept values as they are sent,
-without validating the format or value of the input. **It is
-incumbent upon the source of truth to provide valid information to
-AAI.**
-
-Clients should either use the PATCH API to only change
-the attribute values they mean to change, or do a GET prior to a PUT
-and change only the data that they mean to affect.
-
-The PUT REST APIs expect the payload passed to replace the resource in
-AAI. **A GET before PUT is vital in our concurrency scheme. The
-client will be returned an opaque value per entity which needs to be
-returned back in the PUT. AAI will reject the PUT or DELETE if the
-opaque value doesn't match what AAI has stored for that entity.**
-
-If an attribute has been added to a model in vN+1, and a GET/PUT of a
-vN resource is done, AAI should not affect the new attribute (i.e., it
-should be left unchanged).
-
-Concurrency Control
--------------------
-
-Concurrency control for AAI is in place.
-
-* A client always gets a resource before updating through PUT or deleting it.
-
-* All resource updates and deletions are done via the AAI REST APIs
-
-* This solution will apply to PUT and DELETE operations.
-
-* The resource-version attribute is now in every container
-
-* The PATCH REST verb is not subject to concurrency control, because
- it is only intended to be used by clients who are the definitive
- source of truth for the attributes they are changing. An update
- through the PATCH API will however reset the resource-version so
- clients using PUT and DELETE will not risk updating with stale data.
- If a client would like us to do concurrency control for PATCH, we
- will need a feature request. PATCH is recommended for clients who
- know they are the definitive source of data, as there is less risk
- of destroying other data.
-
-If you use PUT, you MUST send back the entire resource, not just the
-pieces you know about. This is best illustrated by example. Note:
-Specific interfaces only show you the data you are responsible for but
-that does not mean that's all the data that the resource you GET will
-contain. You are responsible to overlay only your changes and leave
-everything else untouched.
-
-Imagine this is the existing resource:
-
-.. code-block:: json
-
- {
- "node-id": "valueOfNodeId",
- "node-name": "valueOfNodeName",
- "prov-status": "NVTPROV",
- "relationship-list": {
- "relationship": [
- {
- "related-link": " /aai/v16/network/generic-vnfs/generic-vnf/generic-vnf-20160902a",
- "related-to": "generic-vnf",
- "relationship-data": [
- {
- "relationship-key": "generic-vnf.vnf-id",
- "relationship-value": "generic-vnf-20160902a"
- }
- ]
- },
- {
- "related-link": " /aai/v16/network/generic-vnfs/generic-vnf/generic-vnf-20161010",
- "related-to": "generic-vnf",
- "relationship-data": [
- {
- "relationship-key": "generic-vnf.vnf-id",
- "relationship-value": "generic-vnf-20161010"
- }
- ]
- }
- ]
- },
- "resource-version": "1474912794"
- }
-
-And you want to update the name and add a relationship to an l3-network.
-
-The payload you need to send back, if you choose PUT, is this. The
-node-name and the third relationship block is the new data, and the
-other data and relationships previously existed and must still be PUT.
-
-.. code-block:: json
-
- {
- "node-id": "valueOfNodeId",
- "node-name": "NEWvalueOfNodeName",
- "prov-status": "NVTPROV",
- "relationship-list": {
- "relationship": [
- {
- "related-link": " /aai/v16/network/generic-vnfs/generic-vnf/generic-vnf-20160902a",
- "related-to": "generic-vnf",
- "relationship-data": [
- {
- "relationship-key": "generic-vnf.vnf-id",
- "relationship-value": "generic-vnf-20160902a"
- }
- ]
- },
- {
- "related-link": " /aai/v16/network/generic-vnfs/generic-vnf/generic-vnf-20161010",
- "related-to": "generic-vnf",
- "relationship-data": [
- {
- "relationship-key": "generic-vnf.vnf-id",
- "relationship-value": "generic-vnf-20161010"
- }
- ]
- },
- {
- "related-link": " /aai/v16/network/l3-networks/l3-network/network-name-for-me",
- "related-to": "l3-network",
- "relationship-data": [
- {
- "relationship-key": "l3-network.network-name",
- "relationship-value": "network-name-for-me"
- }
- ]
- }
- ]
- },
- "resource-version": "1474912794"
- }
-
-A Warning About PUT and Lists
------------------------------
-
-The PUT verb is used to both create and replace a resource. A given
-resource may have child resources (e.g., customers have service
-subscriptions, generic-vnfs have vf-modules, tenants have vservers and
-vservers have volumes).
-
-The following convention will be followed:
-
- If a resource is replaced and there are no tags for children, the
- children that exist will be left alone.
-
- If a resource is replaced and there are tags for children, the
- children will be replaced by the list passed. If the list is empty,
- then children will be deleted.
-
-Note that the relationship list is a type of child resource. The same
-conventions are followed. It is especially critical to ensure that
-you do not send an incomplete relationship list and therefore remove
-edges in the graph. See `The Relationship-List`_ for more information on
-relationship lists. See `Concurrency Control`_ for an example of GET followed by
-PUT containing the entire resource (i.e., overlaying your changes on
-what already exists so that you don't wipe out other data).
-
-PATCH
------
-
-To move towards industry standards and to make our APIs easier to use
-by clients who own specific attributes and do not require AAI to
-enforce concurrency control around them, the PATCH verb has been
-introduced.
-
-.. _RFC 7386: https://tools.ietf.org/html/rfc7386
-
-- RFC Algorithm implemented JSON Merge PATCH: `RFC 7386`_
-- HTTP Verb = PATCH
-- Clients can send a POST with "X-HTTP-Method-Override" = "PATCH" and
- Content-Type = "application/merge-patch+json" to send a PATCH
- request to AAI.
-- PATCH does not support XML
-- PATCH does not require a resource version to perform these modifications
-- Clients should only send what they wish to modify and whose value they "own"
-- PATCH returns a 200 with no response body for success
-
-Example:
-
-.. code::
-
- PATCH https://aai.onap:8443/aai/v16/network/generic-vnfs/generic-vnf/cscf0001v
- {
- "vnf-id": "cscf0001v", <-- This key needs to be here but you cannot modify the key
- "regional-resource-zone": null,
- "ipv4-oam-address": "10.10.99.11"
- }
-
-This payload would result in the generic-vnf with the vnf-id =
-cscf0001v having ipv4-oam-address set to "10.10.99.11" and
-regional-resource-zone having its value removed from the database.
-
-Note: PATCH is used only to update attributes on a single node that
-already exists in AAI. That means it is not applicable to lists of
-any type.
-
- * You do not manage relationships with PATCH. There is a
- relationship API for that.
-
- * You cannot include child objects in a PATCH payload, i.e., you
- cannot PATCH an l3-network's attributes as well as supply some
- subnet children or their attributes within the same PATCH payload.
- You can GET/overlay/PUT parent/child payloads or you can PUT or
- PATCH each object individually with separate REST API calls.
-
-Optional Query Parameters
--------------------------
-
-A **depth** query parameter is available allowing a query to stop after it
-has reached a certain point in the graph. This allows clients to
-minimize the data that is returned to them and make the queries more
-performant. A depth=0 will return information of the node referred to
-by the URI only without any information on the children.
-
-Example
-
-.. code::
-
- GET https://aai.onap:8443/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}?depth=0
-
-A **nodes-only** parameter is available allowing a query to only
-display the properties of the nodes being queried without any
-relationship information. This allows clients to minimize data that is
-returned to them and make the queries more performant.
-
-Example
-
-.. code::
-
- GET https://aai.onap:8443/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}?nodes-only
-
-These parameters may be used in combination with each other.
-
-Example
-
-.. code::
-
- GET https://aai.onap:8443/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}?depth=0&nodes-only
-
-Delete Scope and Edges
-----------------------
-
-An attempt to remove a node which would result in a delete scope being
-violated will return error 5.4.6110.
-
-The swagger documentation has been updated to show information about
-delete scope and edges.
-
-Here is a subset of the generic-vnf definition that will be used to
-demonstrate how the delete scope and edges are documented.
-
-The following table summarizes actions AAI will take upon deletion of a resource, i.e., its default delete scope:
-
-+-----------------------------+--------------------------------------------------------------------+
-| ERROR_IF_ANY_EDGES | If the resource being deleted has any edges at all |
-| | an error should be returned |
-+-----------------------------+--------------------------------------------------------------------+
-| ERROR_IF_ANY_IN_EDGES | If the resource being deleted has any edges that point IN towards |
-| | it, an error should be returned |
-+-----------------------------+--------------------------------------------------------------------+
-| THIS_NODE_ONLY | Delete the vertex being requested by first deleting its edge to |
-| | other vertices, but do not delete the other vertices. Note, the |
-| | delete will be rejected if the deletion target has DEPENDENT |
-| | children (e.g., tenants that have vservers) |
-+-----------------------------+--------------------------------------------------------------------+
-| CASCADE_TO_CHILDREN | Cascade the delete through vertices who have a parentOf |
-| | relationship to the vertex being deleted, as long as the vertex is |
-| | orphaned by the delete of its parent |
-+-----------------------------+--------------------------------------------------------------------+
-| ERROR_4_IN_EDGES_OR_CASCADE | Error if there are any in edges and, if not, cascade to |
-| | children |
-+-----------------------------+--------------------------------------------------------------------+
-
-Edge Documentation
-
-* Node A is the object being defined - e.g., generic-vnf
-
-* Node B is the XXX of OUT TO XXX
-
-* Direction is always Node A OUT TO Node B. Node A has requirement
- satisfied by Node B and the relationship is the edgelabel
-
-* Multiplicity is listed on the OUT TO edges
-
-* The former hasDelTarget is indicated by deletion statements that
- make it clear what gets deleted as a side effect of deleting
- something else.
-
-* The former isChild is indicated by full statements
-
-
-.. parsed-literal::
-
- *generic-vnf: object*
- *General purpose VNF*
-
- *Default Delete Scope*
-
- CASCADE_TO_CHILDREN
-
- * *OUT TO vnfc (org.onap.relationships.inventory.Uses, One2Many, delete of generic-vnf will delete vnfc)*
- * *IN FROM l-interface (l-interface child of generic-vnf)*
- * *IN FROM service-instance*
-
-Server Timeout
---------------
-
-A Server timeout is implemented for these APIs to make sure the server
-did not continue processing the request long after a client times out
-on their side. An error code ERR.5.4.7406 will be returned when this
-limit is hit. The default value for Resources API is 60 secs. The
-clients should set their timeouts accordingly.
-
-Bulk APIs
----------
-
-The Bulk API allows clients to make multiple requests in a single
-transaction. Please look for additional details on the following wiki
-page: `Bulk API <bulkApi.html>`_
-
-Nodes API
----------
-
-In working with A&AI's standard REST API, you may have noticed that
-certain API paths have a hierarchy to them and require a client to
-know multiple object keys to preform GETs. For example: the vserver
-object is under tenant, which is itself under cloud-region. If you
-wanted to look up a vserver by name, you would still need to know the
-tenant-id and cloud-region-id (and cloud-owner) in order to
-successfully perform that GET. The nodes API allows for more freedom
-in querying A&AI, allowing clients to circumvent the need to know
-every key in the hierarchy.
-
-See `Nodes API <nodesApi.html>`_ for more information.
-
-AAI Traversal APIs
-==================
-
-Not all queries of the graph are purely GETs of a specific resource
-and its related vertexes. The following capabilities are available to
-meet more advanced search needs. Please contact the AAI team if you
-need another search.
-
-Nodes Query
------------
-
-The Nodes Query mechanism was implemented in support of searching the
-pservers which do not have the ipv4-oam-ipaddress set. It will allow
-nodes to be searched based on certain properties of the nodes. It will
-allow search based on properties being set, not set or set to specific
-values.
-
-Please reference `Nodes Query <nodesQuery.html>`_ for details on the
-API and test queries.
-
-
-Generic Queries
----------------
-
-The Generic Query mechanism allows to search for certain nodes of
-“include” node types at a specified “depth” from the from a particular
-start node of type “start-node-type” identified by specifying its
-“key” values
-
-
-
-Model Based Query and Delete
-----------------------------
-
-AAI supports a search and delete capability that allows a client to
-retrieve or delete an instance of a service based on the model
-subgraph definition provided to AAI by ASDC.
-
-The instance filters must uniquely identify a service instance.
-
-The URL is as follows:
-
-.. code::
-
- https://{serverRoot}/aai/search/model[?action=DELETE]
-
-.. code-block:: json
-
- {
- "query-parameters": {
- "model": {
- "model-invariant-id": "$modelInvariantId",
- "model-vers": {
- "model-ver": [
- {
- "model-version-id": "$modelVersionId"
- }
- ]
- }
- },
- "instance-filters": {
- "instance-filter": [
- {
- "customer": {
- "global-customer-id": "$globalCustID"
- },
- "service-instance": {
- "resource-version": "$resourceversionID",
- "service-instance-id": "$serviceInstanceID"
- },
- "service-subscription": {
- "service-type": "$serviceType"
- }
- }
- ]
- }
- }
- }
-
-Named Query
------------
-
-These queries provide the ability to upload a json file describing the
-inputs and designed output based on traversing the graph in a
-particular way. Existing named queries are supported but will be
-migrated to custom queries. **Named queries will be deprecated (no new
-queries, just support for existing ones) in Dublin and clients will be
-asked to migrate to use the custom queries instead.**
-
-Custom Query
-------------
-
-This API provides AAI clients an API for complex data retrieval. To
-execute a custom query, a client will perform an HTTP PUT request on
-the query API and include a payload indicating the starting node and
-the query to be run. While the client is performing a PUT request,
-this is actually a data query and no data is created or changed.
-
-Assumptions
-~~~~~~~~~~~
-
-+----------+-----------------------------+--------------------------+
-| No. | Assumption | Approach |
-+==========+=============================+==========================+
-| 1 | Assume that client will | |
-| | not request large amounts | |
-| | of data from AAI w/out | |
-| | using secondary filters | |
-+----------+-----------------------------+--------------------------+
-
-Depdendencies
-~~~~~~~~~~~~~
-
-Data has been PUT to AAI prior to the query.
-
-Custom Query URI
-~~~~~~~~~~~~~~~~
-
-.. code::
-
- PUT /aai/v$/query?format={format}
-
-Query Formats
-~~~~~~~~~~~~~
-
-The format determines what information is returned from the
-query. Acceptable formats are: count, id, pathed, resource,
-resource_and_url, or simple.
-
-count
-^^^^^
-
-Provides an count of the objects returned in the query.
-
-.. code::
-
- PUT /aai/v$/query?format=count
-
-Example reponse
-
-.. code-block:: json
-
- {
- "results": [
- {
- "pnf": 4,
- "p-interface": 5,
- "l-interface": 3,
- "pserver": 1
- }
- ]
- }
-
-id
-^^^
-
-Provides an array of objects containing resource-type (AAI's node
-type; i.e., pnf) and a URI using the vertex ID from AAI's graph.
-
-.. code::
-
- PUT /aai/v$/query?format=id
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "resource-type": "complex",
- "resource-link": "/aai/v1/resources/id/8159312"
- },
- {
- "resource-type": "complex",
- "resource-link": "/aai/v1/resources/id/389256"
- }
- ]
- }
-
-pathed
-^^^^^^
-
-Provides an array of objects containing resource-type (AAIs node type;
-i.e., pnf) and a URI using the AAI REST API pathed URIs
-
-.. code::
-
- PUT /aai/v$/query?format=pathed
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "resource-type": "complex",
- "resource-link": "/aai/v1/cloud-infrastructure/complexes/complex/complex1"
- },
- {
- "resource-type": "complex",
- "resource-link": "/aai/v1/cloud-infrastructure/complexes/complex/complex1"
- }
- ]
- }
-
-resource
-^^^^^^^^
-
-Provides each object in the results array in the same format as AAI's
-REST API with depth = 1 (first level children and cousin
-relationships).
-
-.. code::
-
- PUT /aai/v$/query?format=resource
-
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "complex": {
- "city": "Anywhere",
- "complex-name": "complex-mccomplexface",
- "country": "USA",
- "data-center-code": "CHG",
- "latitude": "30.123456",
- "longitude": "-78.135344",
- "physical-location-id": "complextest1",
- "physical-location-type": "lab",
- "postal-code": "90210",
- "region": "West",
- "relationship-list": {
- "relationship": [
- {
- "related-link": "/aai/v1/network/zones/zone/zone1",
- "related-to": "zone",
- "related-to-property": [
- {
- "property-key": "zone.zone-name",
- "property-value": "zone-name1"
- }
- ],
- "relationship-data": [
- {
- "relationship-key": "zone.zone-id",
- "relationship-value": "zone1"
- }
- ],
- "relationship-label": "org.onap.relationships.inventory.LocatedIn"
- },
- {
- "related-link": "/aai/v1/cloud-infrastructure/cloud-regions/cloud-region/Cloud-Region/Region1",
- "related-to": "cloud-region",
- "related-to-property": [
- {
- "property-key": "cloud-region.owner-defined-type"
- }
- ],
- "relationship-data": [
- {
- "relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "Cloud-Region"
- },
- {
- "relationship-key": "cloud-region.cloud-region-id",
- "relationship-value": "Region1"
- }
- ],
- "relationship-label": "org.onap.relationships.inventory.LocatedIn"
- }
- ]
- },
- "resource-version": "1531233769164",
- "state": "CA",
- "street1": "100 Main St",
- "street2": "C3-3W03"
- }
- }
- ]
- }
-
-resource_and_uri
-^^^^^^^^^^^^^^^^
-
-Provides each object in the results array in the same format as AAI’s
-REST API with depth = 1 (first level children and cousin
-relationships) plus the pathed url for the result object in AAI.
-
-.. code::
-
- PUT /aai/v$/query?format=resource_and_url
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "complex": {
- "city": "Anywhere",
- "complex-name": "complex-mccomplexface",
- "country": "USA",
- "data-center-code": "CHG",
- "latitude": "30.123456",
- "longitude": "-78.135344",
- "physical-location-id": "complextest1",
- "physical-location-type": "lab",
- "postal-code": "90210",
- "region": "West",
- "relationship-list": {
- "relationship": [
- {
- "related-link": "/aai/v16/network/zones/zone/zone1",
- "related-to": "zone",
- "related-to-property": [
- {
- "property-key": "zone.zone-name",
- "property-value": "zone-name1"
- }
- ],
- "relationship-data": [
- {
- "relationship-key": "zone.zone-id",
- "relationship-value": "zone1"
- }
- ],
- "relationship-label": "org.onap.relationships.inventory.LocatedIn"
- },
- {
- "related-link": "/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/Cloud-Region/Region1",
- "related-to": "cloud-region",
- "related-to-property": [
- {
- "property-key": "cloud-region.owner-defined-type"
- }
- ],
- "relationship-data": [
- {
- "relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "Cloud-REgion"
- },
- {
- "relationship-key": "cloud-region.cloud-region-id",
- "relationship-value": "Region1"
- }
- ],
- "relationship-label": "org.onap.relationships.inventory.LocatedIn"
- }
- ]
- },
- "resource-version": "1531233769164",
- "state": "CA",
- "street1": "100 Main St",
- "street2": "C3-3W03"
- },
- "url": "/aai/v16/cloud-infrastructure/complexes/complex/complextest1"
- }
- ]
- }
-
-simple
-^^^^^^
-
-Provides each result object in a simplified format. The node-type,
-graph vertex id, pathed url, object properties, and directly related
-objects in the graph are all returned. Both direct parent/child
-objects and cousin objects are included in the related-to array.
-
-.. code::
-
- PUT /aai/v$/query?format=simple
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "id": "81924184",
- "node-type": "complex",
- "properties": {
- "city": "Anywhere",
- "complex-name": "complex-mccomplexface",
- "country": "USA",
- "data-center-code": "CHG",
- "latitude": "30.123456",
- "longitude": "-78.135344",
- "physical-location-id": "complextest1",
- "physical-location-type": "lab",
- "postal-code": "90210",
- "region": "West",
- "resource-version": "1531233769164",
- "state": "CA",
- "street1": "100 Main St",
- "street2": "C3-3W03"
- },
- "related-to": [
- {
- "id": "40968400",
- "node-type": "zone",
- "relationship-label": "org.onap.relationships.inventory.LocatedIn",
- "url": "/aai/v16/network/zones/zone/zone1"
- },
- {
- "id": "122884184",
- "node-type": "cloud-region",
- "relationship-label": "org.onap.relationships.inventory.LocatedIn",
- "url": "/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/Cloud-Region/Region1"
- },
- {
- "id": "122884296",
- "node-type": "rack",
- "relationship-label": "org.onap.relationships.inventory.LocatedIn",
- "url": "/aai/v16/cloud-infrastructure/complexes/complex/complextest1/racks/rack/rackname1-1test"
- }
- ],
- "url": "/aai/v16/cloud-infrastructure/complexes/complex/complextest1"
- }
- ]
- }
-
-graphson
-^^^^^^^^
-
-Provides the results using the graphson standard.
-
-.. code::
-
- PUT /aai/v$/query?format=graphson
-
-Example Response
-
-.. code-block:: json
-
- {
- "results": [
- {
- "id": 81924184,
- "inE": {
- "org.onap.relationships.inventory.LocatedIn": [
- {
- "id": "oeioq-oe3f4-74l-1crx3s",
- "outV": 40968400,
- "properties": {
- "aai-uuid": "9e75af3d-aa7f-4e8e-a7eb-32d8096f03cc",
- "contains-other-v": "NONE",
- "delete-other-v": "NONE",
- "prevent-delete": "IN",
- "private": false
- }
- },
- {
- "id": "216a6j-215u1k-74l-1crx3s",
- "outV": 122884184,
- "properties": {
- "aai-uuid": "4b3693be-b399-4355-8747-4ea2bb298dff",
- "contains-other-v": "NONE",
- "delete-other-v": "NONE",
- "prevent-delete": "IN",
- "private": false
- }
- },
- {
- "id": "215xjt-215u4o-74l-1crx3s",
- "outV": 122884296,
- "properties": {
- "aai-uuid": "958b8e10-6c42-4145-9cc1-76f50bb3e513",
- "contains-other-v": "IN",
- "delete-other-v": "IN",
- "prevent-delete": "NONE",
- "private": false
- }
- }
- ]
- },
- "label": "vertex",
- "properties": {
- "aai-created-ts": [
- {
- "id": "1crvgr-1crx3s-6bk5",
- "value": 1531231973518
- }
- ],
- "aai-last-mod-ts": [
- {
- "id": "215vkb-1crx3s-6dxh",
- "value": 1531233769164
- }
- ],
- "aai-node-type": [
- {
- "id": "215urv-1crx3s-69z9",
- "value": "complex"
- }
- ],
- "aai-uri": [
- {
- "id": "1crxfv-1crx3s-6gat",
- "value": "/cloud-infrastructure/complexes/complex/complextest1"
- }
- ],
- "aai-uuid": [
- {
- "id": "1crvuz-1crx3s-1ybp",
- "value": "3959ceca-3a89-4e92-a2ff-073b6f409303"
- }
- ],
- "city": [
- {
- "id": "1cs0zv-1crx3s-4irp",
- "value": "Beverley Hills"
- }
- ],
- "complex-name": [
- {
- "id": "215wcr-1crx3s-4d8l",
- "value": "chcil"
- }
- ],
- "country": [
- {
- "id": "1cs26j-1crx3s-4l51",
- "value": "USA"
- }
- ],
- "data-center-code": [
- {
- "id": "215ssr-1crx3s-4bnp",
- "value": "CHG"
- }
- ],
- "last-mod-source-of-truth": [
- {
- "id": "215vyj-1crx3s-696t",
- "value": "aai-AppId"
- }
- ],
- "latitude": [
- {
- "id": "1cs2yz-1crx3s-4mpx",
- "value": "30.123456"
- }
- ],
- "longitude": [
- {
- "id": "1cs3d7-1crx3s-4nid",
- "value": "-174.135344"
- }
- ],
- "physical-location-id": [
- {
- "id": "1crzez-1crx3s-4a2t",
- "value": "complextest1"
- }
- ],
- "physical-location-type": [
- {
- "id": "1crzt7-1crx3s-4ged",
- "value": "lab"
- }
- ],
- "postal-code": [
- {
- "id": "1cs1sb-1crx3s-4kcl",
- "value": "90210"
- }
- ],
- "region": [
- {
- "id": "1cs2kr-1crx3s-4lxh",
- "value": "West"
- }
- ],
- "resource-version": [
- {
- "id": "215v63-1crx3s-glh",
- "value": "1531233769164"
- }
- ],
- "source-of-truth": [
- {
- "id": "1crv2j-1crx3s-6epx",
- "value": "foo"
- }
- ],
- "state": [
- {
- "id": "1cs1e3-1crx3s-4jk5",
- "value": "CA"
- }
- ],
- "street1": [
- {
- "id": "1cs07f-1crx3s-4h6t",
- "value": "100 Main St"
- }
- ],
- "street2": [
- {
- "id": "1cs0ln-1crx3s-4hz9",
- "value": "Room 101"
- }
- ]
- }
- }
- ]
- }
-
-
-Optional Query Parameters
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-depth
-^^^^^
-
-You can pass the depth query parameter to specify how many levels of
-children/grandchildren to return. The default depth is 1.
-
-.. code::
-
- PUT /aai/v$/query?format={format}&depth=0
-
-nodesOnly
-^^^^^^^^^
-
-You can pass the nodesOnly query parameter to have the output only
-contain the object properties with no relationships.
-
-.. code::
-
- PUT /aai/v$/query?format={format}&nodesOnly=true
-
-subgraph
-^^^^^^^^
-
-You can pass a subgraph query parameter that determines the behavior
-of the output. Using subgraph=prune returns all of the objects from
-the query and only the edges between those objects. Using
-subgraph=star returns all of the objects from the query plus all of
-the objects they relate to.
-
-The default is subgraph=star
-
-.. code::
-
- PUT /aai/v$/query?format={format}&subgraph={subgraph}
-
-HTTP Headers
-~~~~~~~~~~~~
-
-+--------------------------+--------------------------------------------------------------------------------------+
-| X-FromAppID={client ID}| Unique application identifier. |
-+--------------------------+--------------------------------------------------------------------------------------+
-| X-TransactionID={UUDID} | must be a UUID and unique to each transaction within the context of an X-FromAppID. |
-+--------------------------+--------------------------------------------------------------------------------------+
-| Content-Type={format} | format of the request. Should be application/json or application/xml. |
-+--------------------------+--------------------------------------------------------------------------------------+
-| Accept={format} | format of the response. Should be application/json or application/xml. |
-+--------------------------+--------------------------------------------------------------------------------------+
-
-Request Payload
-~~~~~~~~~~~~~~~
-
-Typically the query payload will include both a "start" and a "query"
-portion. The "start" can indicate one or more starting nodes in the
-graph. If multiple nodes are specified, the result will contain the
-query results for all of the start nodes. The "query" indicates the
-name of the query to be run and also takes query parameters depending
-on the query. Please reference the queries on the AAI wiki for
-specific saved queries and how they should be usServer Timeout A
-Server timeout is implemented for these APIs to make sure the server
-did not continue processing the request long after a client times out
-on their side. An error code ERR.5.4.7406 will be returned when this
-limit is hit. The default value for Traversal API is 60 secs. The
-clients should set their timeouts accordingly.
-
-List of Queries and Payloads
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-For a full list of available custom queries, please refer to our
-`Custom Queries <customQueries.html>`_ document
-
-Recents API
------------
-
-The Recents API allows a client to get the list of objects that has
-been created or updated recently, up to a maximum of 1 week
-back.
-
-`Recents API <recentsApi.html>`_
diff --git a/docs/AAI REST API Documentation/nodesApi.rst b/docs/AAI REST API Documentation/nodesApi.rst
index e54c0360..3d684860 100644
--- a/docs/AAI REST API Documentation/nodesApi.rst
+++ b/docs/AAI REST API Documentation/nodesApi.rst
@@ -18,11 +18,9 @@ in querying AAI, allowing clients to circumvent the need to know
every key in the hierarchy. Using the previous example, the below is
how the API called would change for looking up a vserver by name:
-.. code::
-
- GET /aai/v$/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers?vserver-name={vserver-name}
- becomes
- GET /aai/v$/nodes/vservers?vserver-name={vserver-name}
+GET /aai/v$/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers?vserver-name={vserver-name}
+becomes
+GET /aai/v$/nodes/vservers?vserver-name={vserver-name}
A side effect of this is that if the same vserver name was reused between
multiple cloud-regions or tenants the client will receive multiple
@@ -35,20 +33,17 @@ API URI
nodes can be used to start a URI from any node type, whether singular or plural.
-.. code::
- GET /aai/v$/nodes/{plural}
- OR
- GET /aai/v$/nodes/{singular}/{key}
+GET /aai/v$/nodes/{plural}
+OR
+GET /aai/v$/nodes/{singular}/{key}
From there, it can be expanded on similarly to our Resources API. For example:
-.. code::
+GET /aai/v$/nodes/{plural}?{property}={value}
+
+GET /aai/v$/nodes/tenant/{tenant-id}/vservers
- GET /aai/v$/nodes/{plural}?{property}={value}
-
- GET /aai/v$/nodes/tenant/{tenant-id}/vservers
-
- GET /aai/v$/nodes/generic-vnf/{vnf-id}/related-to/platforms
+GET /aai/v$/nodes/generic-vnf/{vnf-id}/related-to/platforms
Optional Query Parameters
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -64,9 +59,7 @@ returned. By default the output will be depth = 0 (no "children", only
format query parameter, it will only apply to the on the resource or
resource_and_url formats.
-.. code::
-
- GET /aai/v$/nodes/{plural}/{singular}/{key}?depth={integer}
+GET /aai/v$/nodes/{plural}/{singular}/{key}?depth={integer}
Nodes Only
~~~~~~~~~~
@@ -74,23 +67,19 @@ Nodes Only
You can pass a nodes only query parameter to have the output only contain
the object properties with no relationships.
-.. code::
-
- GET /aai/v$/nodes/{plural}/{singular}/{key}?nodes-only
- OR
- GET /aai/v$/nodes/{plural}/{singular}/{key}?format={format}&nodesOnly=true
+GET /aai/v$/nodes/{plural}/{singular}/{key}?nodes-only
+OR
+GET /aai/v$/nodes/{plural}/{singular}/{key}?format={format}&nodesOnly=true
Format
~~~~~~
You can optionally request an output format different from the default
-REST API output. You can reference the list of formats on the `Custom
-Query <customQueries.html>`_ wiki page for the full list of available
+REST API output. You can reference the list of formats on the
+Query wiki page for the full list of available
formats and examples.
-.. code::
-
- GET /aai/v$/nodes/{plural}/{singular}/{key}?format={format}
+GET /aai/v$/nodes/{plural}/{singular}/{key}?format={format}
Usage with Custom Query
~~~~~~~~~~~~~~~~~~~~~~~
@@ -99,7 +88,5 @@ The Nodes API can be called directly or as the start node for Custom
Queries. Please reference the Custom Queries wiki page for full
documentation on how to use that interface.
-.. code::
-
- PUT /aai/v$/query?format={format} with payload like..
- { "start": ["nodes/{plural}/{singular}/{key}"], "query": "query/{query-name}" }
+PUT /aai/v$/query?format={format} with payload like..
+{ "start": ["nodes/{plural}/{singular}/{key}"], "query": "query/{query-name}" }
diff --git a/docs/AAI REST API Documentation/nodesQuery.rst b/docs/AAI REST API Documentation/nodesQuery.rst
index 4b0a61f4..a86a9e8a 100644
--- a/docs/AAI REST API Documentation/nodesQuery.rst
+++ b/docs/AAI REST API Documentation/nodesQuery.rst
@@ -7,13 +7,13 @@
Nodes Query
===========
-A&AI Nodes Query Implementation Notes:
+A&AI Nodes Query Implementation Notes:
Overview
--------
-AAI continues to support this API, but clients may find that `Custom
-Queries <customQueries.html>`_ meet the needs more most queries.
+AAI continues to support this API, but clients may find that custom
+queries meet the needs more most queries.
The Nodes Query mechanism is mostly being implemented in support of
searching the pservers which do not have the ipv4-oam-ipaddress
@@ -35,7 +35,7 @@ use in which environment/release.
The URL expects the following URL parameters:
-**search-node-type** - node type of the node to be searched.
+**search-node-type** - node type of the node to be searched.
**filter** – list of properties that specify the search
criterion. Format will be
@@ -43,7 +43,7 @@ criterion. Format will be
.. code::
filter=<property-name>:<EQUALS|DOES-NOT-EQUAL|EXISTS|DOES-NOT-EXIST>:<property-value>
-
+
such as
filter=ipv4-oam-address:DOES-NOT-EXIST:
@@ -53,7 +53,7 @@ For EXISTS and DOES-NOT-EXIST the property value is not specified
The queries return a search-results object back which includes a list
of result-data which contains the node-type and a link for each
-resource that was found.
+resource that was found.
Requirements
@@ -67,7 +67,7 @@ Requirements
* The search results can be asked to be returned in json or xml based
on the ACCEPT header.
-
+
* If no filter params are specified, it would return all nodes of that node type.
Design
@@ -93,13 +93,13 @@ Design
Supported queries
-----------------
-* Search pserver nodes for which ipv4-oam-address DOES-NOT-EXIST
+* Search pserver nodes for which ipv4-oam-address DOES-NOT-EXIST
.. code::
URL:
/aai/v16/search/nodes-query?search-node-type=pserver&filter=ipv4-oam-address:DOES-NOT-EXIST:
-
+
Search result
.. code::
diff --git a/docs/AAI REST API Documentation/recentsApi.rst b/docs/AAI REST API Documentation/recentsApi.rst
index 74e423c8..8283538b 100644
--- a/docs/AAI REST API Documentation/recentsApi.rst
+++ b/docs/AAI REST API Documentation/recentsApi.rst
@@ -21,7 +21,7 @@ Request
The API can be accessed by using sending a GET request to the Recents
API and sending a single node-type and a parameter to specify either
timestamp to start the search or the number of hours to look back.
-
+
Querying with number of hours
.. code::
@@ -45,7 +45,7 @@ object type, URI, and resource-version.
Sample response:
-.. code-block:: json
+.. code::
{
"results": [
@@ -59,5 +59,5 @@ Sample response:
"resource-link": "/aai/v16/network/pnfs/pnf/stack01"
"resource-version": "1531413113612"
},...]
-
+
}
diff --git a/docs/_static/css/ribbon.css b/docs/_static/css/ribbon.css
index 6008cb1a..afb9480d 100644
--- a/docs/_static/css/ribbon.css
+++ b/docs/_static/css/ribbon.css
@@ -59,5 +59,5 @@
/* fix width of the screen */
.wy-nav-content {
- max-width: none;
+ max-width: 800px;
}
diff --git a/docs/conf.py b/docs/conf.py
index 3a7958d1..a9c42b67 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,17 +1,56 @@
-from docs_conf.conf import *
+project = "onap"
+release = "master"
+version = "master"
-branch = 'latest'
-master_doc = 'index'
-release = 'master'
-version = 'master'
+author = "Open Network Automation Platform"
+# yamllint disable-line rule:line-length
+copyright = "ONAP. Licensed under Creative Commons Attribution 4.0 International License"
-linkcheck_ignore = [
- 'http://localhost',
+pygments_style = "sphinx"
+html_theme = "sphinx_rtd_theme"
+html_theme_options = {
+ "style_nav_header_background": "white",
+ "sticky_navigation": "False" }
+html_logo = "_static/logo_onap_2017.png"
+html_favicon = "_static/favicon.ico"
+html_static_path = ["_static"]
+html_show_sphinx = False
+
+extensions = [
+ 'sphinx.ext.intersphinx',
+ 'sphinx.ext.graphviz',
+ 'sphinxcontrib.blockdiag',
+ 'sphinxcontrib.seqdiag',
+ 'sphinxcontrib.swaggerdoc',
+ 'sphinxcontrib.plantuml'
]
+#
+# Map to 'latest' if this file is used in 'latest' (master) 'doc' branch.
+# Change to {releasename} after you have created the new 'doc' branch.
+#
+
+branch = 'latest'
+
intersphinx_mapping = {}
+doc_url = 'https://docs.onap.org/projects'
+master_doc = 'index'
+
+exclude_patterns = ['.tox']
+
+spelling_word_list_filename='spelling_wordlist.txt'
+spelling_lang = "en_GB"
+
+#
+# Example:
+# intersphinx_mapping['onap-aai-aai-common'] = ('{}/onap-aai-aai-common/en/%s'.format(doc_url) % branch, None)
+#
html_last_updated_fmt = '%d-%b-%y %H:%M'
def setup(app):
app.add_css_file("css/ribbon.css")
+
+linkcheck_ignore = [
+ r'http://localhost:\d+/'
+]
diff --git a/docs/index.rst b/docs/index.rst
index 2fff958c..4ba174df 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -17,3 +17,9 @@ The key AAI repos for running the AAI REST APIs:
platform/index.rst
release-notes.rst
AAI REST API Documentation/AAIRESTAPI.rst
+ AAI REST API Documentation/bulkApi.rst
+ AAI REST API Documentation/customQueries.rst
+ AAI REST API Documentation/genericQueries.rst
+ AAI REST API Documentation/nodesApi.rst
+ AAI REST API Documentation/nodesQuery.rst
+ AAI REST API Documentation/recentsApi.rst
diff --git a/docs/platform/Getting Started/AAI_Developer_Environment_Setup.rst b/docs/platform/Getting Started/AAI_Developer_Environment_Setup.rst
index c8afd9c1..4122a9e0 100644
--- a/docs/platform/Getting Started/AAI_Developer_Environment_Setup.rst
+++ b/docs/platform/Getting Started/AAI_Developer_Environment_Setup.rst
@@ -33,7 +33,7 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
Running `nodetool statusthrift`... OK (returned exit status 0 and printed string "running").
Forking Elasticsearch...
Connecting to Elasticsearch (127.0.0.1:9200)...... OK (connected to 127.0.0.1:9200).
- Forking Gremlin-Server...
+ Forking Gremlin-Server...
Connecting to Gremlin-Server (127.0.0.1:8182).... OK (connected to 127.0.0.1:8182).
Run gremlin.sh to connect.
@@ -59,7 +59,7 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
1. $ sudo apt-get -y install haproxy
2. $ <path-to-haproxy>/haproxy -v
- Response should be:
+ Response should be:
.. code-block:: bash
@@ -79,9 +79,9 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
$ sudo cp aai.pem /etc/ssl/private/aai.pem
$ sudo chmod 640 /etc/ssl/private/aai.pem
- $ sudo chown root:ssl-cert /etc/ssl/private/aai.pem
+ $ sudo chown root:ssl-cert /etc/ssl/private/aai.pem
- Add these hostnames to the loopback interface in /etc/hosts:
+ Add these hostnames to the loopback interface in /etc/hosts:
127.0.0.1 localhost aai-traversal.api.simpledemo.openecomp.org aai-resources.api.simpledemo.openecomp.org aai-traversal.api.simpledemo.onap.org aai-resources.api.simpledemo.onap.org
@@ -101,12 +101,6 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
$ mkdir ~/.m2
$ cp settings.xml ~/.m2
- If you get an error on some of the repos saying that oparent is
- unresolvable, using the example settings.xml file should solve this
- problem: `Setting Up Your Development
- Environment#MavenExamplesettings.xml
- <https://wiki.onap.org/display/DW/Setting+Up+Your+Development+Environment#SettingUpYourDevelopmentEnvironment-MavenExamplesettings.xml>`__
-
5. Set Up Repos
---------------
@@ -127,8 +121,8 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
Modify both janus-cached.properties and janus-realtime.properties to the following (for all MS’s that will connect to the local Cassandra backend)
- .. code::
-
+ .. code::
+
storage.backend=cassandra
storage.hostname=localhost
storage.cassandra.keyspace=onap # or different keyspace name of your choosing
@@ -183,7 +177,7 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
9. Janus setup (part 2)
-----------------------
-
+
Run this on the local instance on your first time running AAI and whenever using new keyspace or after wiping the data.
Install the schema
@@ -194,7 +188,7 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
You should see:
- .. code::
+ .. code::
---- NOTE --- about to open graph (takes a little while)--------;
-- Loading new schema elements into JanusGraph --
@@ -271,10 +265,10 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
> PUT /aai/v16/cloud-infrastructure/complexes/complex/clli2 HTTP/1.1
> GET /aai/v16/cloud-infrastructure/complexes/complex/clli2 HTTP/1.1
- With payload:
+ With payload:
.. code-block:: json
-
+
{
"physical-location-id": "clli2",
"data-center-code": "example-data-center-code-val-6667",
@@ -294,7 +288,7 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
"elevation": "example-elevation-val-28399",
"lata": "example-lata-val-28399"
}
-
+
And finishes with:
.. code-block:: bash
@@ -303,7 +297,7 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
> GET /aai/v16/cloud-infrastructure/complexes HTTP/1.1
With the following:
-
+
.. code-block:: json
{
@@ -319,10 +313,10 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
]
}
}
- }
+ }
12. Start the "traversal" microservice
---------------------------------------
+--------------------------------------
Traversal runs on port 8446. Go to the traversal directory
@@ -331,7 +325,7 @@ For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 1
$ cd ~/src/aai/traversal
Set the debug port to 9446
-
+
$ export MAVEN_OPTS="-Xms1024m -Xmx5120m -XX:PermSize=2024m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9446,server=y,suspend=n"
Start the microservice - adjust your build version accordingly
diff --git a/docs/platform/Getting Started/Queries/vnf_to_esr_system_info_Named_Query.rst b/docs/platform/Getting Started/Queries/vnf_to_esr_system_info_Named_Query.rst
index 7ad412a9..078801a4 100644
--- a/docs/platform/Getting Started/Queries/vnf_to_esr_system_info_Named_Query.rst
+++ b/docs/platform/Getting Started/Queries/vnf_to_esr_system_info_Named_Query.rst
@@ -7,7 +7,7 @@ vnf to esr-system-info Named Query
**Example Request**
-POST https://127.0.0.1:8443/aai/search/named-query
+POST /aai/search/named-query
{
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index 06c27aed..ac4ab012 100644
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -16,7 +16,7 @@ Release Data
============
Version: 11.0.0
---------------
+---------------
:Release Date: 2022-11-10
@@ -94,15 +94,14 @@ For more information on the ONAP Honolulu release, please see:
.. _`ONAP Release Downloads`: https://git.onap.org
Version: 10.0.0
---------------
+---------------
:Release Date: 2022-06-02
The R10 Jakarta release of ONAP A&AI addressed security vulnerabilities and enhanced the model for the CCVPN Use Case
- Schema updated for CCVPN use case mainly enhancing and bug fixes of the Cloud Leased Line (CLL) service
-- Updated versions for indy, httpclient, freemarker, activemq, commons-io, commons-compress, logback-core,
-commons-codec, groovy, netty-all, netty-handler, gson, and snakeyaml in various mS
+- Updated versions for indy, httpclient, freemarker, activemq, commons-io, commons-compress, logback-core, commons-codec, groovy, netty-all, netty-handler, gson, and snakeyaml in various mS
- Please note log4j is still on older versions in a transitive dependency for aaf auth for the following mS
* onap-aai-aai-common
* onap-aai-babel
@@ -967,7 +966,7 @@ Source code of AAI is released under the following repositories at https://gerri
**Known Issues**
-If the either the aai-resources or aai-traversal pod is deleted, haproxy will not automatically detect when the pod is re-instantiated. As a temporary workaround, you can delete the haproxy pod (the one named "aai", for example, "dev-aai-8794fbff5-clx7d") and when the aai pod restarts the service should operate normally. A proposed fix is here: https://gerrit.onap.org/r/#/c/51075/1 if you want to see how to configure the haproxy service to auto-recover when the IP address of either the aai-resources or aai-traversal pod changes.
+If the either the aai-resources or aai-traversal pod is deleted, haproxy will not automatically detect when the pod is re-instantiated. As a temporary workaround, you can delete the haproxy pod (the one named "aai", for example, "dev-aai-8794fbff5-clx7d") and when the aai pod restarts the service should operate normally. A proposed fix is `here <https://gerrit.onap.org/r/c/oom/+/51075/1>`_ if you want to see how to configure the haproxy service to auto-recover when the IP address of either the aai-resources or aai-traversal pod changes.
**Security Notes**
@@ -1164,8 +1163,6 @@ Source code of AAI is released under the following repositories at https://gerri
- `AAI-61 <https://jira.onap.org/browse/AAI-61>`_ AAI cleaned up references to OpenECOMP but in order to keep the release stable for R1, the XML namespace still contains openecomp.
-Client systems should use http://org.openecomp.aai.inventory/v11 as the XML namespace for ONAP AAI R1.
-
**Security Issues**
See Common Vulnerabilities and Exposures `CVE <https://cve.mitre.org>`
diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt
index 3b3441a8..71df2ab0 100644
--- a/docs/requirements-docs.txt
+++ b/docs/requirements-docs.txt
@@ -1,3 +1,7 @@
-lfdocs-conf
sphinx>=4.2.0 # BSD
sphinx-rtd-theme>=1.0.0 # MIT
+sphinxcontrib-blockdiag # BSD
+sphinxcontrib-seqdiag # BSD
+sphinxcontrib-swaggerdoc
+sphinxcontrib-spelling
+sphinxcontrib-plantuml
diff --git a/docs/tox.ini b/docs/tox.ini
index 49bbe010..6e1245c7 100644
--- a/docs/tox.ini
+++ b/docs/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 1.6
-envlist = docs,
+envlist = docs,docs-linkcheck,docs-spellcheck
skipsdist = true
[testenv:docs]
@@ -8,18 +8,25 @@ basepython = python3.8
deps =
-r{toxinidir}/requirements-docs.txt
-chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt
- -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
+ -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt?h=master
commands =
- sphinx-build -b html -n -d {envtmpdir}/doctrees ./ {toxinidir}/_build/html
- echo "Generated docs available in {toxinidir}/_build/html"
-whitelist_externals =
- echo
- git
- sh
+ sphinx-build -W -q -b html -n -d {envtmpdir}/doctrees {toxinidir} {toxinidir}/_build/html
[testenv:docs-linkcheck]
basepython = python3.8
-#deps = -r{toxinidir}/requirements-docs.txt
-commands = echo "Link Checking not enforced"
-#commands = sphinx-build -b linkcheck -d {envtmpdir}/doctrees ./ {toxinidir}/_build/linkcheck
-whitelist_externals = echo
+deps =
+ -r{toxinidir}/requirements-docs.txt
+ -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt
+ -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt?h=master
+commands =
+ sphinx-build -W -q -b linkcheck -d {envtmpdir}/doctrees {toxinidir} {toxinidir}/_build/linkcheck
+
+[testenv:docs-spellcheck]
+basepython = python3.8
+deps =
+ -r{toxinidir}/requirements-docs.txt
+ -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt
+ -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt?h=master
+commands =
+ sphinx-build -W -q -b spelling -d {envtmpdir}/doctrees {toxinidir} {toxinidir}/_build/spellcheck
+