diff options
author | 2019-03-11 09:34:34 +0200 | |
---|---|---|
committer | 2019-03-17 17:02:43 +0200 | |
commit | 66af8b9b391879be78660d6ccb0a1f1f9340b423 (patch) | |
tree | fc0d510f7ea28a437bcb1e3b950d1281ac88a4e4 /vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDelete.java | |
parent | 37ad0cc1d36ec6ff68ec39fcaaf2617eef7d08fe (diff) |
Merge automation from ECOMP's repository
Reference commit in ECOMP: 8e92a8c6
Issue-ID: VID-378
Change-Id: Ia32f4813378ef95097f788246aa5b1172e20ca48
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDelete.java')
-rw-r--r-- | vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDelete.java | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDelete.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDelete.java new file mode 100644 index 000000000..04d7522a3 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDelete.java @@ -0,0 +1,70 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public class PresetMSODeactivateAndCloudDelete extends BaseMSOPreset { + private final String serviceInstanceId; + private final String vnfInstanceId; + private final String vfModuleInstanceId; + private final String requestId; + public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; + public static final String DEFAULT_REQUEST_ID = "318cc766-b673-4a50-b9c5-471f68914584"; + + public PresetMSODeactivateAndCloudDelete(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId, String requestId, String cloudOwner) { + this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; + this.vnfInstanceId = vnfInstanceId; + this.vfModuleInstanceId = vfModuleInstanceId; + this.requestId = requestId != null ? requestId : DEFAULT_REQUEST_ID; + this.cloudOwner = cloudOwner; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/vfModules/" + vfModuleInstanceId + "/deactivateAndCloudDelete"; + } + + @Override + public String getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelType\": \"vfModule\"" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"hvf6\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"requestParameters\": { " + + " \"testApi\": \"GR_API\", " + + " \"userParams\": [] " + + " } " + + " }" + + "}"; + } + + @Override + public Object getResponseBody() { + return "{\"requestReferences\":{\"instanceId\":\"" + serviceInstanceId + "\",\"requestId\":\"" + requestId + "\"}}"; + } + + @Override + public int getResponseCode() { + return 202; + } + + @Override + public boolean isStrictMatch() { + return true; + } +} |