diff options
author | 2019-07-08 15:46:44 +0300 | |
---|---|---|
committer | 2019-07-08 18:50:38 +0300 | |
commit | f4dff328c0386c8901b5841943b11f0c13b3169f (patch) | |
tree | 4e64c3ee540410b2593c1ebecd0dddd3a4780592 /vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/AAIBaseGetL3NetworksByCloudRegionPreset.java | |
parent | f792671ae247a931f34d902e9276202b5016ef9a (diff) |
Merge from ecomp 718fd196 - Integration Tests
Issue-ID: VID-378
Change-Id: Icc0bdb9ef37b1d429d47c2070f76d1ee63ad7489
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/AAIBaseGetL3NetworksByCloudRegionPreset.java')
-rw-r--r-- | vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/AAIBaseGetL3NetworksByCloudRegionPreset.java | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/AAIBaseGetL3NetworksByCloudRegionPreset.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/AAIBaseGetL3NetworksByCloudRegionPreset.java new file mode 100644 index 000000000..e20c09ba1 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/AAIBaseGetL3NetworksByCloudRegionPreset.java @@ -0,0 +1,76 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +import java.util.*; + +public class AAIBaseGetL3NetworksByCloudRegionPreset extends BaseAAIPreset { + + public static final String DEFAULT_TENANT_ID = "b530fc990b6d4334bd45518bebca6a51"; + public static final String DEFAULT_TENANT_NAME = "ecomp_ispt"; + public static final String DEFAULT_CLOUD_REGION_ID = PresetAAIGetCloudOwnersByCloudRegionId.AUK51A; + private static final String DEFAULT_CLOUD_OWNER = PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; + protected String tenantId; + protected String tenantName; + protected String cloudRegionId; + protected String cloudOwner; + protected String networkRole; + + public AAIBaseGetL3NetworksByCloudRegionPreset(String tenentId, String tenantName, String cloudRegionId, String cloudOwner, String networkRole) { + this.tenantId = tenentId; + this.tenantName = tenantName; + this.cloudRegionId = cloudRegionId; + this.cloudOwner = cloudOwner; + this.networkRole = networkRole; + } + + public AAIBaseGetL3NetworksByCloudRegionPreset() { + this.tenantId = DEFAULT_TENANT_ID; + this.tenantName = DEFAULT_TENANT_NAME; + this.cloudRegionId = DEFAULT_CLOUD_REGION_ID; + this.cloudOwner = DEFAULT_CLOUD_OWNER; + } + + public String getTenantName() { + return tenantName; + } + + public String getTenantId() { + return tenantId; + } + + public String getCloudRegionId() { + return cloudRegionId; + } + + public String getCloudOwner() { + return cloudOwner; + } + + @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("resource") + ); + } + + @Override + public Object getRequestBody() { + return ImmutableMap.of( + "start", "/cloud-infrastructure/cloud-regions/cloud-region/" + cloudOwner + "/" + cloudRegionId, + "query", "query/l3-networks-by-cloud-region?tenantId=" + tenantId + (networkRole == null ? "" : "&networkRole=" + networkRole) + ); + } +} |