diff options
author | as221v <as221v@intl.att.com> | 2019-09-09 17:56:41 +0300 |
---|---|---|
committer | Alexey Sandler <alexey.sandler@intl.att.com> | 2019-09-12 15:55:52 +0300 |
commit | c4814252e8ef58dde843824d1c4d57ea708a961e (patch) | |
tree | b870ffa4e3fbc4791b87fcbc2815a6dec7f97276 /vid-automation/src/main/java/org | |
parent | 2609cc76f0565466667fff8ae4d0707b94993877 (diff) |
Reduce vnf data response from A&AI in change management flows
Issue-ID: VID-596
Signed-off-by: Amir Skalka <as221v@intl.att.com>
Change-Id: I4462ef0c2dbc9880d1a0d204f6552e3842aad821
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Diffstat (limited to 'vid-automation/src/main/java/org')
-rw-r--r-- | vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetBaseAAICustomQuery.java | 54 |
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 + ); + } + +} |