summaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-09-12 14:11:27 +0000
committerGerrit Code Review <gerrit@onap.org>2019-09-12 14:11:27 +0000
commitecd0453d3ca7c54d32af7b033f8098e25ca4392b (patch)
tree0ca21081953862dc813fe57b2452c028d080dcb6 /vid-automation/src/main/java
parent76a44c4f838747b01ef819d2d673b5f680780f3f (diff)
parentc4814252e8ef58dde843824d1c4d57ea708a961e (diff)
Merge "Reduce vnf data response from A&AI in change management flows"
Diffstat (limited to 'vid-automation/src/main/java')
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetBaseAAICustomQuery.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetBaseAAICustomQuery.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetBaseAAICustomQuery.java
new file mode 100644
index 000000000..a979bae53
--- /dev/null
+++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetBaseAAICustomQuery.java
@@ -0,0 +1,54 @@
+package org.onap.simulator.presetGenerator.presets.aai;
+
+import com.google.common.collect.ImmutableMap;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset;
+import org.springframework.http.HttpMethod;
+
+public abstract class PresetBaseAAICustomQuery extends BaseAAIPreset {
+
+ private final String requestBodyStart;
+ private final String requestBodyQuery;
+ private final FORMAT format;
+
+ public enum FORMAT {
+ RESOURCE, SIMPLE;
+
+ public String value() {
+ return this.name().toLowerCase();
+ }
+ }
+ public PresetBaseAAICustomQuery(FORMAT format, String requestBodyStart, String requestBodyQuery) {
+ this.format = format;
+ this.requestBodyStart = requestBodyStart;
+ this.requestBodyQuery = requestBodyQuery;
+ }
+
+ @Override
+ public HttpMethod getReqMethod() {
+ return HttpMethod.PUT;
+ }
+
+ @Override
+ public String getReqPath() {
+ return getRootPath() + "/query";
+ }
+
+ @Override
+ public Map<String, List> getQueryParams() {
+ return ImmutableMap.of(
+ "format", Collections.singletonList(format.value())
+ );
+ }
+
+ @Override
+ public Object getRequestBody() {
+ return ImmutableMap.of(
+ "start", new String[] {requestBodyStart},
+ "query", requestBodyQuery
+ );
+ }
+
+}