diff options
Diffstat (limited to 'vid-automation/src/main/java/org/onap')
20 files changed, 779 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetActivateServiceInstancePost.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetActivateServiceInstancePost.java new file mode 100644 index 000000000..5a4528edc --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetActivateServiceInstancePost.java @@ -0,0 +1,12 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPresetServiceInstanceOperationsPost; + +/** + * Created by itzikliderman on 13/12/2017. + */ +public class PresetActivateServiceInstancePost extends BaseMSOPresetServiceInstanceOperationsPost { + public String getReqPath() { + return getRootPath() + "/activate"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetDeactivateServiceInstancePost.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetDeactivateServiceInstancePost.java new file mode 100644 index 000000000..016adb344 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetDeactivateServiceInstancePost.java @@ -0,0 +1,12 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPresetServiceInstanceOperationsPost; + +/** + * Created by itzikliderman on 13/12/2017. + */ +public class PresetDeactivateServiceInstancePost extends BaseMSOPresetServiceInstanceOperationsPost { + public String getReqPath() { + return getRootPath() + "/deactivate"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOAssignServiceInstanceGen2WithNames.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOAssignServiceInstanceGen2WithNames.java new file mode 100644 index 000000000..4d7b85027 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOAssignServiceInstanceGen2WithNames.java @@ -0,0 +1,16 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import java.util.Map; + +public class PresetMSOAssignServiceInstanceGen2WithNames extends PresetMSOServiceInstanceGen2WithNames { + + + public PresetMSOAssignServiceInstanceGen2WithNames(Map<Keys, String> names, int suffix) { + super(names, suffix); + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v7/serviceInstances/assign"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseCreateServiceInstancePost.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseCreateServiceInstancePost.java new file mode 100644 index 000000000..703829213 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseCreateServiceInstancePost.java @@ -0,0 +1,34 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public abstract class PresetMSOBaseCreateServiceInstancePost extends BaseMSOPreset { + private final String requestId; + public static final String DEFAULT_REQUEST_ID = "c0011670-0e1a-4b74-945d-8bf5aede1d9c"; + + public PresetMSOBaseCreateServiceInstancePost() { + this(null); + } + + public PresetMSOBaseCreateServiceInstancePost(String requestId) { + this.requestId = requestId != null ? requestId : DEFAULT_REQUEST_ID; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public int getResponseCode() { + return 202; + } + + + + @Override + public Object getResponseBody() { + return "{\"requestReferences\":{\"instanceId\":\"f8791436-8d55-4fde-b4d5-72dd2cf13cfb\",\"requestId\":\"" + requestId + "\"}}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseDelete.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseDelete.java new file mode 100644 index 000000000..99433e0a2 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseDelete.java @@ -0,0 +1,37 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public abstract class PresetMSOBaseDelete extends BaseMSOPreset { + private final String requestId; + public static final String DEFAULT_REQUEST_ID = "c0011670-0e1a-4b74-945d-8bf5aede1d9c"; + + public PresetMSOBaseDelete() { + this(null ); + } + + public PresetMSOBaseDelete(String requestId) { + this.requestId = requestId != null ? requestId : DEFAULT_REQUEST_ID; + } + + @Override + protected String getRootPath() { + return super.getRootPath() + "/serviceInstances/v./"; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.DELETE; + } + + @Override + public int getResponseCode() { + return 202; + } + + @Override + public Object getResponseBody() { + return "{\"requestReferences\":{\"instanceId\":\"f8791436-8d55-4fde-b4d5-72dd2cf13cfb\",\"requestId\":\"" + requestId + "\"}}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2.java new file mode 100644 index 000000000..3dbebd5e5 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2.java @@ -0,0 +1,104 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateServiceInstanceGen2 extends PresetMSOBaseCreateServiceInstancePost{ + + public PresetMSOCreateServiceInstanceGen2() { + } + + public PresetMSOCreateServiceInstanceGen2(String requestId) { + super(requestId); + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v7/serviceInstances"; + } + + @Override + public Object getRequestBody() { + return "" + + "{ " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelInvariantId\": \"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\", " + + " \"modelVersionId\": \"1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd\", " + + " \"modelName\": \"action-data\", " + + " \"modelType\": \"service\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"owningEntity\": { " + + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\", " + + " \"owningEntityName\": \"MetroPacketCore\" " + + " }, " + + " \"subscriberInfo\": { " + + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + + " }, " + + " \"project\": { " + + " \"projectName\": \"DFW\" " + + " }, " + + " \"requestInfo\": { " + +// " \"instanceName\": \"some instance name_0" + suffix + "\", " + + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + + " \"source\": \"VID\", " + + " \"suppressRollback\": true, " + + " \"requestorId\": \"us16807000\" " + + " }, " + + " \"requestParameters\": { " + + " \"subscriptionServiceType\": \"VIRTUAL USP\", " + + " \"aLaCarte\": false, " + + " \"userParams\": [{ " + + " \"service\": { " + + " \"modelInfo\": { " + + " \"modelVersionId\": \"1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd\", " + + " \"modelName\": \"action-data\", " + + " \"modelType\": \"service\" " + + " }, " + +// " \"instanceName\": \"some instance name_0" + suffix + "\", " + + " \"instanceParams\": [], " + + " \"resources\": { " + + " \"vnfs\": [{ " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017-488_ADIOD-vPE 0\", " + + " \"modelCustomizationId\": \"1da7b585-5e61-4993-b95e-8e6606c81e45\", " + + " \"modelInvariantId\": \"72e465fe-71b1-4e7b-b5ed-9496118ff7a8\", " + + " \"modelVersionId\": \"69e09f68-8b63-4cc9-b9ff-860960b5db09\", " + + " \"modelName\": \"2017-488_ADIOD-vPE\", " + + " \"modelType\": \"vnf\", " + + " \"modelVersion\": \"5.0\" " + + " }, " + + " \"cloudConfiguration\": { " + + " \"lcpCloudRegionId\": \"mtn6\", " + + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\" " + + " }, " + + " \"platform\": { " + + " \"platformName\": \"platform\" " + + " }, " + + " \"lineOfBusiness\": { " + + " \"lineOfBusinessName\": \"ECOMP\" " + + " }, " + + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + + " \"instanceParams\": [], " + + " \"vfModules\": [{ " + + " \"modelInfo\": { " + + " \"modelInvariantId\": \"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\", " + + " \"modelVersionId\": \"25284168-24bb-4698-8cb4-3f509146eca5\", " + + " \"modelName\": \"2017488AdiodVpe..ADIOD_vRE_BV..module-1\", " + + " \"modelType\": \"vfModule\", " + + " \"modelVersion\": \"6\" " + + " }, " + +// " \"instanceName\": \"VFinstancename_00" + suffix + "\", " + + " \"instanceParams\": [] " + + " } " + + " ] " + +// " \"instanceName\": \"2017488_ADIODvPEVNFinstancename_00" + suffix + "\" " + + " } " + + " ] " + + " } " + + " } " + + " } " + + " ] " + + " } " + + " } " + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNames.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNames.java new file mode 100644 index 000000000..89008b99b --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNames.java @@ -0,0 +1,15 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import java.util.Map; + +public class PresetMSOCreateServiceInstanceGen2WithNames extends PresetMSOServiceInstanceGen2WithNames { + + public PresetMSOCreateServiceInstanceGen2WithNames(Map<Keys, String> names, int suffix) { + super(names, suffix); + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v7/serviceInstances"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstancePost.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstancePost.java new file mode 100644 index 000000000..931fe59e3 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstancePost.java @@ -0,0 +1,12 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +/** + * Created by itzikliderman on 13/12/2017. + */ +public class PresetMSOCreateServiceInstancePost extends PresetMSOBaseCreateServiceInstancePost { + + public String getReqPath() { + return getRootPath() + "/serviceInstances/v6"; + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVNFInstancePost.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVNFInstancePost.java new file mode 100644 index 000000000..443d78e81 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVNFInstancePost.java @@ -0,0 +1,21 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVNFInstancePost extends PresetMSOBaseCreateServiceInstancePost { + private String serviceInstanceId; + private String serviceModelVersionId; + + public PresetMSOCreateVNFInstancePost(String serviceInstanceId, String serviceModelVersionId) { + this.serviceInstanceId = serviceInstanceId; + this.serviceModelVersionId = serviceModelVersionId; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstances/v./" + serviceInstanceId + "/vnfs"; + } + + @Override + public Object getRequestBody() { + return "{\"requestDetails\":{\"requestInfo\":{\"productFamilyId\":\"e433710f-9217-458d-a79d-1c7aff376d89\",\"source\":\"VID\",\"suppressRollback\":false,\"requestorId\":\"us16807000\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"ecomp\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"AAIAIC25\",\"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"},\"platform\":{\"platformName\":\"plat1\"},\"modelInfo\":{\"modelCustomizationId\":\"882e5dcb-ba9f-4766-8cde-e326638107db\",\"modelCustomizationName\":\"vDBE 0\",\"modelVersionId\":\"61535073-2e50-4141-9000-f66fea69b433\",\"modelName\":\"vDBE\",\"modelInvariantId\":\"fcdf49ce-6f0b-4ca2-b676-a484e650e734\",\"modelType\":\"vnf\",\"modelVersion\":\"0.2\"},\"requestParameters\":{\"userParams\":[],\"testApi\":\"GR_API\"},\"relatedInstanceList\":[{\"relatedInstance\":{\"instanceId\":\"" + serviceInstanceId + "\",\"modelInfo\":{\"modelVersionId\":\"" + serviceModelVersionId + "\",\"modelName\":\"vDBE_srv\",\"modelInvariantId\":\"9aa04749-c02c-432d-a90c-18caa361c833\",\"modelType\":\"service\",\"modelVersion\":\"1.0\"}}},{\"relatedInstance\":{\"instanceId\":\"AAI-12002-test3-vm230w\",\"modelInfo\":{\"modelName\":\"oam_group\",\"modelType\":\"networkCollection\",\"modelVersion\":\"1\",\"modelVersionId\":\"a0efd5fc-f7be-4502-936a-a6c6392b958f\",\"modelInvariantId\":\"9384abf9-1231-4da4-bd8d-89e4d2f8a749\"}}},{\"relatedInstance\":{\"instanceId\":\"AAI-12002-test3-vm230w\",\"modelInfo\":{\"modelName\":\"oam_group\",\"modelType\":\"networkCollection\",\"modelVersion\":\"1\",\"modelVersionId\":\"a0efd5fc-f7be-4502-936a-a6c6392b958f\",\"modelInvariantId\":\"9384abf9-1231-4da4-bd8d-89e4d2f8a749\"}}}]}}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleInstancePost.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleInstancePost.java new file mode 100644 index 000000000..4f662ee87 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleInstancePost.java @@ -0,0 +1,62 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVfModuleInstancePost extends PresetMSOBaseCreateServiceInstancePost{ + private String serviceInstanceId; + private String vnfInstanceId; + + public PresetMSOCreateVfModuleInstancePost(String serviceInstanceId, String vnfInstanceId) { + this.serviceInstanceId = serviceInstanceId; + this.vnfInstanceId = vnfInstanceId; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstances/v./" + serviceInstanceId + "/vnfs/"+vnfInstanceId+"/vfModules"; + } + + @Override + public Object getRequestBody() { + return "{" + + "\"requestDetails\":{" + + "\"requestInfo\":{" + + "\"instanceName\":\"aa\"," + + "\"source\":\"VID\"," + + "\"suppressRollback\":false," + + "\"requestorId\":\"us16807000\"" + + "}," + + "\"modelInfo\":{" + + "\"modelType\":\"vfModule\"," + + "\"modelInvariantId\":\"\"," + + "\"modelVersionId\":\"\"," + + "\"modelName\":\"\"," + + "\"modelVersion\":\"\"," + + "\"modelCustomizationId\":\"\"," + + "\"modelCustomizationName\":\"\"" + + "}," + + "\"requestParameters\":{" + + "\"userParams\":[" + + "]," + + "\"usePreload\":false" + + "}," + + "\"cloudConfiguration\":{" + + "\"lcpCloudRegionId\":\"mdt1\"," + + "\"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"" + + "}," + + "\"relatedInstanceList\":[" + + "{" + + "\"relatedInstance\":{" + + "\"instanceId\":\"" + serviceInstanceId + "\","+ + "\"modelInfo\":{" + + "\"modelType\":\"service\"," + + "\"modelName\":\"Demo Service 1\"," + + "\"modelInvariantId\":\"709d1be4-9a3f-4a29-8c4d-a20465e808a3\"," + + "\"modelVersion\":\"1.0\"," + + "\"modelVersionId\":\"240376de-870e-48df-915a-31f140eedd2c\"" + + "}" + + "}" + + "}" + + "]" + + "}" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceOrchestrationRequestGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceOrchestrationRequestGet.java new file mode 100644 index 000000000..bfe3a24c5 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceOrchestrationRequestGet.java @@ -0,0 +1,64 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public class PresetMSODeleteInstanceOrchestrationRequestGet extends BaseMSOPreset { + + private final static String DEFAULT_REQUEST_ID = "c0011670-0e1a-4b74-945d-8bf5aede1d9c"; + private final String requestId; + private final String requestScope; + String requestState; + + public PresetMSODeleteInstanceOrchestrationRequestGet() { + this("Service"); + } + + public PresetMSODeleteInstanceOrchestrationRequestGet(String requestScope) { + this(requestScope, "COMPLETE"); + } + + public PresetMSODeleteInstanceOrchestrationRequestGet(String requestScope, String requestState) { + this.requestScope = requestScope; + this.requestState = requestState; + this.requestId = DEFAULT_REQUEST_ID; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + public String getReqPath() { + return getRootPath() + "/orchestrationRequests/v5/" + requestId; + } + + @Override + public Object getResponseBody() { + return "{" + + " \"request\": {" + + " \"requestId\": \"" + requestId + "\"," + + " \"startTime\": \"Mon, 11 Dec 2017 07:27:49 GMT\"," + + " \"requestScope\": \"" + this.requestScope.toLowerCase() + "\"," + + " \"requestType\": \"deleteInstance\"," + + " \"instanceReferences\": {" + + " \"serviceInstanceId\": \"f8791436-8d55-4fde-b4d5-72dd2cf13cfb\"," + + " \"serviceInstanceName\": \"asdfasdf234234asdf\"," + + " \"requestorId\": \"il883e\"" + + " }," + + " \"requestStatus\": {" + + " \"requestState\": \"" + requestState + "\"," + + " \"statusMessage\": \"" + getStatusMessage() + "\"," + + " \"percentProgress\": 100," + + " \"finishTime\": \"Mon, 11 Dec 2017 07:27:53 GMT\"" + + " }" + + " }" + + "}"; + } + + private String getStatusMessage() { + return "COMPLETE".equals(requestState) ? + this.requestScope + " has been deleted successfully." : + (this.requestScope + " has been " + requestState.toLowerCase() + " successfully."); + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteNetwork.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteNetwork.java new file mode 100644 index 000000000..426dec3d9 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteNetwork.java @@ -0,0 +1,23 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSODeleteNetwork extends PresetMSOBaseDelete { + private final String serviceInstanceId; + private final String networkInstanceId; + public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; + public static final String DEFAULT_NETWORK_INSTANCE_ID = "6adc05e4-85c6-4f91-aa5a-1eb9546c4369"; + + public PresetMSODeleteNetwork() { + this(null, null, null); + } + + public PresetMSODeleteNetwork(String requestId, String serviceInstanceId, String networkInstanceId) { + super(requestId); + this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; + this.networkInstanceId = networkInstanceId != null ? networkInstanceId : DEFAULT_NETWORK_INSTANCE_ID; + } + + @Override + public String getReqPath() { + return getRootPath() + serviceInstanceId + "/networks/" + networkInstanceId; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteService.java new file mode 100644 index 000000000..b407b167a --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteService.java @@ -0,0 +1,30 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import vid.automation.test.infra.Features; + +public class PresetMSODeleteService extends PresetMSOBaseDelete { + private final String serviceInstanceId; + public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; + + public PresetMSODeleteService() { + this(null, null); + } + + public PresetMSODeleteService(String requestId, String serviceInstanceId) { + super(requestId); + this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; + } + + @Override + public String getReqPath() { + return getRootPath() + serviceInstanceId; + } + + @Override + protected String getRootPath() { + return Features.FLAG_UNASSIGN_SERVICE.isActive() ? + "/mso/serviceInstantiation/v./serviceInstances/" : + "/mso/serviceInstances/v./"; + + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModule.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModule.java new file mode 100644 index 000000000..76487edf5 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModule.java @@ -0,0 +1,26 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSODeleteVfModule extends PresetMSOBaseDelete { + private final String serviceInstanceId; + private final String vnfInstanceId; + private final String vfModuleInstanceId; + public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; + public static final String DEFAULT_VNF_INSTANCE_ID = "c015cc0f-0f37-4488-aabf-53795fd93cd3"; + public static final String DEFAULT_VFMODULE_INSTANCE_ID = "f2805715-e24f-4c8a-9eb3-6c618da7691d"; + + public PresetMSODeleteVfModule() { + this(null, null, null, null); + } + + public PresetMSODeleteVfModule(String requestId, String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId) { + super(requestId); + this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; + this.vnfInstanceId = vnfInstanceId != null ? vnfInstanceId : DEFAULT_VNF_INSTANCE_ID; + this.vfModuleInstanceId = vfModuleInstanceId != null ? vfModuleInstanceId : DEFAULT_VFMODULE_INSTANCE_ID; + } + + @Override + public String getReqPath() { + return getRootPath() + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/vfModules/" + vfModuleInstanceId; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVnf.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVnf.java new file mode 100644 index 000000000..83c9883f8 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVnf.java @@ -0,0 +1,23 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSODeleteVnf extends PresetMSOBaseDelete { + private final String serviceInstanceId; + private final String vnfInstanceId; + public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; + public static final String DEFAULT_VNF_INSTANCE_ID = "9908b762-136f-4b1f-8eb4-ef670ef58bb4"; + + public PresetMSODeleteVnf() { + this(null, null, null); + } + + public PresetMSODeleteVnf(String requestId, String serviceInstanceId, String vnfInstanceId) { + super(requestId); + this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; + this.vnfInstanceId = vnfInstanceId != null ? vnfInstanceId : DEFAULT_VNF_INSTANCE_ID; + } + + @Override + public String getReqPath() { + return getRootPath() + serviceInstanceId + "/vnfs/" + vnfInstanceId; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVolumeGroup.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVolumeGroup.java new file mode 100644 index 000000000..d9598b20d --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVolumeGroup.java @@ -0,0 +1,26 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSODeleteVolumeGroup extends PresetMSOBaseDelete { + private final String serviceInstanceId; + private final String vnfInstanceId; + private final String volumeGroupInstanceId; + public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; + public static final String DEFAULT_VNF_INSTANCE_ID = "c015cc0f-0f37-4488-aabf-53795fd93cd3"; + public static final String DEFAULT_VG_INSTANCE_ID = "d9db0900-31f6-4880-8658-8c996c6123b4"; + + public PresetMSODeleteVolumeGroup() { + this(null, null, null, null); + } + + public PresetMSODeleteVolumeGroup(String requestId, String serviceInstanceId, String vnfInstanceId, String volumeGroupInstanceId) { + super(requestId); + this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; + this.vnfInstanceId = vnfInstanceId != null ? vnfInstanceId : DEFAULT_VNF_INSTANCE_ID; + this.volumeGroupInstanceId = volumeGroupInstanceId != null ? volumeGroupInstanceId : DEFAULT_VG_INSTANCE_ID; + } + + @Override + public String getReqPath() { + return getRootPath() + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/volumeGroups/" + volumeGroupInstanceId; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestGet.java new file mode 100644 index 000000000..dcf1a054d --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestGet.java @@ -0,0 +1,77 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.apache.commons.lang3.StringUtils; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +/** + * Created by itzikliderman on 13/12/2017. + */ +public class PresetMSOOrchestrationRequestGet extends BaseMSOPreset { + + private final String DEFAULT_REQUEST_ID = "c0011670-0e1a-4b74-945d-8bf5aede1d9c"; + private final String requestId; + private String statusMessage; + String requestState; + + public PresetMSOOrchestrationRequestGet() { + requestState = "COMPLETE"; + this.requestId = DEFAULT_REQUEST_ID; + } + + public PresetMSOOrchestrationRequestGet(String requestState) { + this.requestState = requestState; + this.requestId = DEFAULT_REQUEST_ID; + } + + public PresetMSOOrchestrationRequestGet(String requestState, String overrideRequestId) { + this.requestState = requestState; + this.requestId = overrideRequestId; + } + + public PresetMSOOrchestrationRequestGet(String requestState, String overrideRequestId, String statusMessage) { + this.requestState = requestState; + this.requestId = overrideRequestId; + this.statusMessage = statusMessage; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + public String getReqPath() { + return getRootPath() + "/orchestrationRequests/v5/" + requestId; + } + + @Override + public Object getResponseBody() { + return "{" + + " \"request\": {" + + " \"requestId\": \"" + requestId + "\"," + + " \"startTime\": \"Mon, 11 Dec 2017 07:27:49 GMT\"," + + " \"requestScope\": \"service\"," + + " \"requestType\": \"createInstance\"," + + " \"instanceReferences\": {" + + " \"serviceInstanceId\": \"f8791436-8d55-4fde-b4d5-72dd2cf13cfb\"," + + " \"serviceInstanceName\": \"asdfasdf234234asdf\"," + + " \"requestorId\": \"il883e\"" + + " }," + + " \"requestStatus\": {" + + " \"requestState\": \"" + requestState + "\"," + + " \"statusMessage\": \"" + getStatusMessage() + "\"," + + " \"percentProgress\": 100," + + " \"finishTime\": \"Mon, 11 Dec 2017 07:27:53 GMT\"" + + " }" + + " }" + + "}"; + } + + private String getStatusMessage() { + if (!StringUtils.isEmpty(statusMessage)) + return statusMessage; + return "COMPLETE".equals(requestState) ? + "Service Instance was created successfully." : + ("Service Instance was " + requestState.toLowerCase() + " successfully."); + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestGetErrorResponse.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestGetErrorResponse.java new file mode 100644 index 000000000..dfd2c55d6 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestGetErrorResponse.java @@ -0,0 +1,24 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOOrchestrationRequestGetErrorResponse extends PresetMSOOrchestrationRequestGet { + private final int responseCode; + + public PresetMSOOrchestrationRequestGetErrorResponse(int responseCode) { + this.responseCode = responseCode; + } + + @Override + public int getResponseCode() { + return responseCode; + } + + @Override + public Object getResponseBody() { + return "{" + + " \"serviceException\": {" + + " \"messageId\": \"SVC0002\"," + + " \"text\": \"JSON Object Mapping Request\"" + + " }" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOServiceInstanceGen2ErrorResponse.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOServiceInstanceGen2ErrorResponse.java new file mode 100644 index 000000000..881cc4634 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOServiceInstanceGen2ErrorResponse.java @@ -0,0 +1,30 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOServiceInstanceGen2ErrorResponse extends PresetMSOBaseCreateServiceInstancePost { + + private final int responseCode; + + public PresetMSOServiceInstanceGen2ErrorResponse(int responseCode) { + this.responseCode = responseCode; + } + + @Override + public int getResponseCode() { + return responseCode; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v7/serviceInstances/assign"; + } + + @Override + public Object getResponseBody() { + return "{" + + " \"serviceException\": {" + + " \"messageId\": \"SVC0002\"," + + " \"text\": \"JSON Object Mapping Request\"" + + " }" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOServiceInstanceGen2WithNames.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOServiceInstanceGen2WithNames.java new file mode 100644 index 000000000..52c3071fa --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOServiceInstanceGen2WithNames.java @@ -0,0 +1,131 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import java.util.Map; + +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.*; + +public abstract class PresetMSOServiceInstanceGen2WithNames extends PresetMSOBaseCreateServiceInstancePost{ + + public enum Keys { + SERVICE_NAME, VNF_NAME, VFM_NAME1, VFM_NAME2, VG_NAME + } + + private final Map<Keys, String> names; + + private final String suffix; + + public PresetMSOServiceInstanceGen2WithNames(Map<Keys, String> names, int suffix) { + this.names = names; + this.suffix = "_" + String.format("%03d", suffix); + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelInvariantId\": \"300adb1e-9b0c-4d52-bfb5-fa5393c4eabb\"," + + " \"modelVersionId\": \"5c9e863f-2716-467b-8799-4a67f378dcaa\"," + + " \"modelName\": \"AIM_TRANSPORT_00004\"," + + " \"modelType\": \"service\"," + + " \"modelVersion\": \"1.0\"" + + " }," + + " \"owningEntity\": {" + + " \"owningEntityId\": \"someID\"," + + " \"owningEntityName\": \"someName\"" + + " }," + + " \"subscriberInfo\": {" + + " \"globalSubscriberId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" + + " }," + + " \"project\": {" + + " \"projectName\": \"myProject\"" + + " }," + + " \"requestInfo\": {" + + " \"instanceName\": \""+ names.get(SERVICE_NAME) + suffix + "\"," + + " \"productFamilyId\": \"myProductFamilyId\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"ab2222\"" + + " }," + + " \"requestParameters\": {" + + " \"subscriptionServiceType\": \"mySubType\"," + + " \"aLaCarte\": false," + + " \"userParams\": [" + + " {" + + " \"service\": {" + + " \"modelInfo\": {" + + " \"modelVersionId\": \"5c9e863f-2716-467b-8799-4a67f378dcaa\"," + + " \"modelName\": \"AIM_TRANSPORT_00004\"," + + " \"modelType\": \"service\"" + + " }," + + " \"instanceName\": \""+ names.get(SERVICE_NAME) + suffix + "\"," + + " \"instanceParams\": []," + + " \"resources\": {" + + " \"vnfs\": [" + + " {" + + " \"modelInfo\": {" + + " \"modelCustomizationName\": \"2016-73_MOW-AVPN-vPE-BV-L 0\"," + + " \"modelCustomizationId\": \"ab153b6e-c364-44c0-bef6-1f2982117f04\"," + + " \"modelVersionId\": \"7f40c192-f63c-463e-ba94-286933b895f8\"," + + " \"modelName\": \"2016-73_MOW-AVPN-vPE-BV-L\"," + + " \"modelType\": \"vnf\"" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"mtn3\"," + + " \"tenantId\": \"greatTenant\"" + + " }," + + " \"platform\": {" + + " \"platformName\": \"platformName\"" + + " }," + + " \"lineOfBusiness\": {" + + " \"lineOfBusinessName\": \"lineOfBusinessName\"" + + " }," + + " \"productFamilyId\": \"myProductFamilyId\"," + + " \"instanceParams\": []," + + " \"vfModules\": [" + + " {" + + " \"modelInfo\": {" + + " \"modelCustomizationId\": \"a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f\"," + + " \"modelVersionId\": \"4c75f813-fa91-45a4-89d0-790ff5f1ae79\"," + + " \"modelName\": \"201673MowAvpnVpeBvL..AVPN_base_vPE_BV..module-0\"," + + " \"modelType\": \"vfModule\"" + + " }," + + " \"instanceName\": \""+ names.get(VFM_NAME1) + suffix +"\"," + + " \"instanceParams\": [" + + " {" + + " \"vmx_int_net_len\": \"24\"" + + " }" + + " ]" + + " }," + + " {" + + " \"modelInfo\": {" + + " \"modelCustomizationId\": \"72d9d1cd-f46d-447a-abdb-451d6fb05fa8\"," + + " \"modelVersionId\": \"56e2b103-637c-4d1a-adc8-3a7f4a6c3240\"," + + " \"modelName\": \"201673MowAvpnVpeBvL..AVPN_vRE_BV..module-1\"," + + " \"modelType\": \"vfModule\"" + + " }," + + " \"instanceName\": \"" + names.get(VFM_NAME2) + suffix + "\"," + + " \"volumeGroupInstanceName\" : \"" + names.get(VG_NAME) + suffix + "\"," + + " \"instanceParams\": [" + + " {" + + " \"vre_a_volume_size_0\": \"100\"," + + " \"availability_zone_0\": \"mtpocdv-kvm-az01\"" + + " }" + + " ]" + + " }" + + " ]," + + " \"instanceName\": \"" + names.get(VNF_NAME)+ suffix + "\"" + + " }" + + " ]" + + " }" + + " }" + + " }" + + " ]" + + " }" + + " }" + + "}"; + + } + + +} |