From 66af8b9b391879be78660d6ccb0a1f1f9340b423 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Mon, 11 Mar 2019 09:34:34 +0200 Subject: Merge automation from ECOMP's repository Reference commit in ECOMP: 8e92a8c6 Issue-ID: VID-378 Change-Id: Ia32f4813378ef95097f788246aa5b1172e20ca48 Signed-off-by: Ittay Stern --- .../presets/BasePresets/BaseMSOPreset.java | 19 +- .../presets/BasePresets/BasePreset.java | 26 +- .../presets/aaf/AAFGetBasicAuthPreset.java | 31 ++ .../presets/aaf/AAFGetUrlServicePreset.java | 26 ++ .../presets/aai/BasePresetAAIGetVersion.java | 48 --- ...AICloudRegionAndSourceFromConfigurationPut.java | 9 +- .../aai/PresetAAIFilterServiceInstanceById.java | 39 ++ .../PresetAAIGetCloudOwnersByCloudRegionId.java | 130 +++++++ .../aai/PresetAAIGetCloudRegionFromVnf.java | 130 +++++++ .../presets/aai/PresetAAIGetHomingForVfModule.java | 150 ++++++++ .../PresetAAIGetInstanceGroupsByCloudRegion.java | 2 +- ...tInstanceGroupsByCloudRegionInvalidRequest.java | 238 ++++++------- ...InstanceGroupsByCloudRegionRequiredMissing.java | 2 +- .../aai/PresetAAIGetModelsByOwningEntity.java | 21 +- .../presets/aai/PresetAAIGetModelsByProject.java | 13 +- .../presets/aai/PresetAAIGetMultipleVersion.java | 59 --- .../aai/PresetAAIGetNetworkCollectionDetails.java | 14 +- ...IGetNetworkCollectionDetailsInvalidRequest.java | 16 +- ...GetNetworkCollectionDetailsRequiredMissing.java | 11 +- .../presets/aai/PresetAAIGetNetworkZones.java | 8 +- .../presets/aai/PresetAAIGetOneVersion.java | 33 -- .../aai/PresetAAIGetPNFByRegionErrorPut.java | 2 +- .../aai/PresetAAIGetPortMirroringSourcePorts.java | 13 +- .../PresetAAIGetRelatedInstanceGroupsByVnfId.java | 13 +- .../PresetAAIGetServiceInstancesByInvariantId.java | 90 +++++ .../presets/aai/PresetAAIGetServiceModelList.java | 80 ----- .../presets/aai/PresetAAIGetServicesGet.java | 26 +- .../presets/aai/PresetAAIGetSubDetailsGet.java | 21 +- .../PresetAAIGetSubDetailsGetSpecificService.java | 114 ++++++ .../PresetAAIGetSubDetailsWithoutInstancesGet.java | 153 ++++++++ ...bDetailsWithoutInstancesGetSpecificService.java | 67 ++++ .../presets/aai/PresetAAIGetSubscribersGet.java | 80 +++-- .../presets/aai/PresetAAIGetTenants.java | 24 +- .../presets/aai/PresetAAIGetVfModulesByVnf.java | 83 +++++ .../aai/PresetAAIModelsByInvariantIdGet.java | 394 +++++++++++++++++++++ .../aai/PresetAAIPostNamedQueryForViewEdit.java | 44 ++- .../aai/PresetAAISearchNodeQueryEmptyResult.java | 14 - .../PresetAAISearchNodeQueryNonEmptyResult.java | 46 +++ .../aai/PresetAAIServiceDesignAndCreationPut.java | 119 +++++-- .../presets/aai/PresetAAIStandardQueryGet.java | 239 +++++++++++++ .../PresetGetSessionSlotCheckIntervalGet.java | 2 +- .../presets/model/RegistrationRequest.java | 24 +- .../presetGenerator/presets/model/Subscriber.java | 5 + .../mso/PresetMSOActivateFabricConfiguration.java | 61 ++++ ...SOActivateFabricConfigurationErrorResponse.java | 62 ++++ ...PresetMSOAddOrRemoveOneInstanceGroupMember.java | 60 ++++ ...resetMSOAssignServiceInstanceGen2WithNames.java | 5 +- .../mso/PresetMSOBaseCreateInstancePost.java | 68 ++++ .../PresetMSOBaseCreateServiceInstancePost.java | 34 -- .../presets/mso/PresetMSOBaseDelete.java | 19 +- .../PresetMSOBaseDeleteWithCloudConfiguration.java | 36 ++ .../mso/PresetMSOCreateMacroPre1806Post.java | 63 ++++ .../mso/PresetMSOCreateNetworkALaCarte5G.java | 79 +++++ .../mso/PresetMSOCreateNetworkALaCarteCypress.java | 68 ++++ .../PresetMSOCreateNetworkALaCarteOldViewEdit.java | 65 ++++ ...setMSOCreateNetworkALaCarteServiceCypress2.java | 68 ++++ ...erviceInstanceAlacarte5GServiceWithNetwork.java | 59 +++ .../mso/PresetMSOCreateServiceInstanceGen2.java | 34 +- ...SOCreateServiceInstanceGen2AlacarteService.java | 55 +++ ...tMSOCreateServiceInstanceGen2ErrorResponse.java | 24 ++ ...resetMSOCreateServiceInstanceGen2WithNames.java | 14 +- ...stanceGen2WithNamesAlacarteGroupingService.java | 63 ++++ ...erviceInstanceGen2WithNamesAlacarteService.java | 60 ++++ ...nstanceGen2WithNamesAlacarteServiceCypress.java | 58 +++ ...rviceInstanceGen2WithNamesEcompNamingFalse.java | 327 +++++++++++++++++ ...eServiceInstanceMultipleVnfsServiceCypress.java | 56 +++ .../mso/PresetMSOCreateServiceInstancePost.java | 4 +- ...reateVNFInstanceOnlyRelatedServiceInstance.java | 74 ++++ .../mso/PresetMSOCreateVNFInstancePost.java | 21 -- .../presets/mso/PresetMSOCreateVfModule.java | 78 ++++ .../PresetMSOCreateVfModuleALaCarteCypress.java | 115 ++++++ .../mso/PresetMSOCreateVfModuleInstancePost.java | 62 ---- .../mso/PresetMSOCreateVfModuleOldViewEdit.java | 81 +++++ ...eateVfModuleWithVolumeGroupALaCarteCypress.java | 116 ++++++ .../mso/PresetMSOCreateVnfALaCarteCypress2.java | 51 +++ .../mso/PresetMSOCreateVnfALaCarteOldViewEdit.java | 69 ++++ .../PresetMSOCreateVnfALaCarteServiceCypress.java | 51 +++ .../PresetMSOCreateVnfALaCarteServiceCypress2.java | 47 +++ .../presets/mso/PresetMSOCreateVnfBase.java | 25 ++ .../presets/mso/PresetMSOCreateVnfGroup.java | 68 ++++ .../presets/mso/PresetMSOCreateVnfVlanTagging.java | 94 +++++ .../mso/PresetMSOCreateVolumeGroupOldViewEdit.java | 78 ++++ .../mso/PresetMSODeactivateAndCloudDelete.java | 70 ++++ ...etMSODeactivateAndCloudDeleteErrorResponse.java | 70 ++++ .../mso/PresetMSODeleteALaCarteService.java | 58 +++ .../mso/PresetMSODeleteBaseVfModuleCypress.java | 38 ++ .../presets/mso/PresetMSODeleteGroupMembers.java | 51 +++ .../presets/mso/PresetMSODeleteInstanceGroup.java | 28 ++ ...etMSODeleteInstanceOrchestrationRequestGet.java | 2 +- .../presets/mso/PresetMSODeleteNetwork.java | 6 +- .../mso/PresetMSODeleteNetworkAlaCarteCypress.java | 56 +++ .../presets/mso/PresetMSODeleteVfModule.java | 4 +- .../mso/PresetMSODeleteVfModuleCypress.java | 38 ++ .../presets/mso/PresetMSODeleteVnf.java | 4 +- .../mso/PresetMSODeleteVnfAlaCarteCypress.java | 48 +++ .../presets/mso/PresetMSODeleteVolumeGroup.java | 10 +- .../mso/PresetMSOOrchestrationRequestGet.java | 66 +++- ...tionRequestsGet5GServiceInstanceAndNetwork.java | 179 ++++++++++ ...esetMSOOrchestrationRequestsGetByRequestId.java | 85 +++++ ...rchestrationRequestsGetByServiceInstanceId.java | 158 +++++++++ ...chestrationRequestsManyInstanceStatusesGet.java | 160 +++++++++ ...setMSOOrchestrationRequestsManyStatusesGet.java | 210 +++++++++++ ...tionRequestsManyStatusesInvalidResponseGet.java | 19 + .../PresetMSOServiceInstanceGen2ErrorResponse.java | 4 +- .../mso/PresetMSOServiceInstanceGen2WithNames.java | 54 ++- .../PresetMsoChangeManagementBase.java | 28 ++ .../PresetMsoVnfInPlaceSoftwareUpdate.java | 37 ++ .../mso/changeManagement/PresetMsoVnfReplace.java | 58 +++ .../mso/changeManagement/PresetMsoVnfUpdate.java | 67 ++++ .../configuration/PresetMSOActOnConfiguration.java | 70 ++++ .../PresetMSOCreateConfiguration.java | 117 ++++++ .../PresetMSODeleteConfiguration.java | 53 +++ .../configuration/PresetMsoEnableDisablePort.java | 76 ++++ ...etSchedulerChangeManagementInvalidResponse.java | 17 + .../PresetGetSchedulerChangeManagements.java | 162 +++++++++ .../sdc/PresetSDCGetServiceMetadataGet.java | 10 +- .../sdc/PresetSDCGetServiceToscaModelGet.java | 8 +- ...resetSDCGetServiceToscaModelGetEmptyResult.java | 24 ++ ...tSDCGetServiceToscaModelGetInvalidResponse.java | 32 ++ 119 files changed, 6637 insertions(+), 690 deletions(-) create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aaf/AAFGetBasicAuthPreset.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aaf/AAFGetUrlServicePreset.java delete mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/BasePresetAAIGetVersion.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIFilterServiceInstanceById.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudOwnersByCloudRegionId.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudRegionFromVnf.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetHomingForVfModule.java delete mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetMultipleVersion.java delete mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetOneVersion.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServiceInstancesByInvariantId.java delete mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServiceModelList.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGetSpecificService.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGet.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGetSpecificService.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetVfModulesByVnf.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGet.java delete mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryEmptyResult.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfiguration.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfigurationErrorResponse.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOAddOrRemoveOneInstanceGroupMember.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseCreateInstancePost.java delete mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseCreateServiceInstancePost.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseDeleteWithCloudConfiguration.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateMacroPre1806Post.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarte5G.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteCypress.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteOldViewEdit.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteServiceCypress2.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2AlacarteService.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2ErrorResponse.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteService.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceMultipleVnfsServiceCypress.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVNFInstanceOnlyRelatedServiceInstance.java delete mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVNFInstancePost.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModule.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java delete mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleInstancePost.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleOldViewEdit.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteCypress2.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteOldViewEdit.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteServiceCypress.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteServiceCypress2.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfBase.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfGroup.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfVlanTagging.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVolumeGroupOldViewEdit.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDelete.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDeleteErrorResponse.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteALaCarteService.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteBaseVfModuleCypress.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteGroupMembers.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceGroup.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteNetworkAlaCarteCypress.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModuleCypress.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVnfAlaCarteCypress.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByRequestId.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByServiceInstanceId.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyInstanceStatusesGet.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyStatusesGet.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyStatusesInvalidResponseGet.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoChangeManagementBase.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfInPlaceSoftwareUpdate.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfReplace.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfUpdate.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOActOnConfiguration.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOCreateConfiguration.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSODeleteConfiguration.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMsoEnableDisablePort.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetGetSchedulerChangeManagementInvalidResponse.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetGetSchedulerChangeManagements.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGetEmptyResult.java create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGetInvalidResponse.java (limited to 'vid-automation/src/main/java/org/onap/simulator') diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java index 8194d87ac..4f4779d8e 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java @@ -1,5 +1,6 @@ package org.onap.simulator.presetGenerator.presets.BasePresets; +import java.util.Map; import vid.automation.test.infra.Features; /** @@ -7,13 +8,17 @@ import vid.automation.test.infra.Features; */ public abstract class BaseMSOPreset extends BasePreset { + public static final String DEFAULT_CLOUD_OWNER = "irma-aic"; + public static final String DEFAULT_INSTANCE_ID = "f8791436-8d55-4fde-b4d5-72dd2cf13cfb"; + protected String cloudOwner = DEFAULT_CLOUD_OWNER; + public static String getRequestBodyWithTestApiOnly() { if (Features.FLAG_ADD_MSO_TESTAPI_FIELD.isActive()) { return "" + "{" + " \"requestDetails\": { " + " \"requestParameters\": { " + - " \"testApi\": \"GR_API\" " + + " \"testApi\": \"VNF_API\" " + " } " + " } " + "} " + @@ -23,8 +28,20 @@ public abstract class BaseMSOPreset extends BasePreset { } } + protected String addCloudOwnerIfNeeded() { + return Features.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST.isActive() ? + "\"cloudOwner\": \""+cloudOwner+"\"," : ""; + } + @Override protected String getRootPath() { return "/mso"; } + + @Override + public Map getRequestHeaders() { + Map map = super.getRequestHeaders(); + map.put("X-ONAP-PartnerName", "VID"); + return map; + } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java index 162367368..662677e83 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java @@ -1,11 +1,10 @@ package org.onap.simulator.presetGenerator.presets.BasePresets; -import org.onap.simulator.presetGenerator.presets.model.RegistrationRequest; -import org.springframework.http.HttpMethod; - import java.util.HashMap; import java.util.List; import java.util.Map; +import org.onap.simulator.presetGenerator.presets.model.RegistrationRequest; +import org.springframework.http.HttpMethod; /** * Created by itzikliderman on 13/12/2017. @@ -13,12 +12,13 @@ import java.util.Map; public abstract class BasePreset { public RegistrationRequest generateScenario() { - Map headers = new HashMap<>(); - headers.put("Content-Type", getContentType()); + Map responseHeaders = new HashMap<>(); + responseHeaders.put("Content-Type", getContentType()); return new RegistrationRequest( - new RegistrationRequest.SimulatorRequest(getReqMethod(), getReqPath(), getQueryParams(), getRequestBody()), - new RegistrationRequest.SimulatorResponse(getResponseCode(), headers, getResponseBody(), getFile())); + new RegistrationRequest.SimulatorRequest(getReqMethod(), getReqPath(), getQueryParams(), getRequestBody(), isStrictMatch(), getRequestHeaders()), + new RegistrationRequest.SimulatorResponse(getResponseCode(), responseHeaders, getResponseBody(), getFile()), + new RegistrationRequest.Misc(getNumberOfTimes(), getReplace())); } public Object getResponseBody() { return null; }; @@ -41,7 +41,19 @@ public abstract class BasePreset { return null; } + public boolean isStrictMatch() { + return false; + } + public Map getQueryParams() { return null; } protected abstract String getRootPath(); + + protected Integer getNumberOfTimes() {return null;} + + protected boolean getReplace() {return true;} + + public Map getRequestHeaders() { + return new HashMap<>(); + } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aaf/AAFGetBasicAuthPreset.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aaf/AAFGetBasicAuthPreset.java new file mode 100644 index 000000000..f7900d14b --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aaf/AAFGetBasicAuthPreset.java @@ -0,0 +1,31 @@ +package org.onap.simulator.presetGenerator.presets.aaf; + +import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; +import org.springframework.http.HttpMethod; + +import java.util.Map; + +public class AAFGetBasicAuthPreset extends BasePreset { + public static final String VALID_AUTH_VALUE = "bTEyMzRAYXR0LmNvbTphYWFh"; + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return "/authn/basicAuth"; + } + + @Override + protected String getRootPath() { + return ""; + } + + @Override + public Map getRequestHeaders() { + return ImmutableMap.of("Authorization", "Basic " + VALID_AUTH_VALUE); + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aaf/AAFGetUrlServicePreset.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aaf/AAFGetUrlServicePreset.java new file mode 100644 index 000000000..b3376e61a --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aaf/AAFGetUrlServicePreset.java @@ -0,0 +1,26 @@ +package org.onap.simulator.presetGenerator.presets.aaf; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; +import org.springframework.http.HttpMethod; + +public class AAFGetUrlServicePreset extends BasePreset { + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return "/locate/com.att.aaf.service:2.0"; + } + + @Override + protected String getRootPath() { + return ""; + } + + @Override + public Object getResponseBody() { + return "{\"endpoint\":[{\"name\":\"com.att.aaf.service\",\"major\": 2,\"minor\": 0,\"patch\": 19,\"pkg\": 21,\"latitude\": 38.627346,\"longitude\": -90.19377,\"protocol\": \"http\",\"subprotocol\": [],\"hostname\": \"127.0.0.1\",\"port\": 1080}]}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/BasePresetAAIGetVersion.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/BasePresetAAIGetVersion.java deleted file mode 100644 index 2452a24f7..000000000 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/BasePresetAAIGetVersion.java +++ /dev/null @@ -1,48 +0,0 @@ -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.Collections; -import java.util.List; -import java.util.Map; - -public class BasePresetAAIGetVersion extends BaseAAIPreset { - public String modelVersionId1; - public String modelInvariantId; - - public BasePresetAAIGetVersion(String modelVersionId1, String modelInvariantId) { - this.modelVersionId1 = modelVersionId1; - this.modelInvariantId = modelInvariantId; - } - @Override - public HttpMethod getReqMethod() { - return HttpMethod.PUT; - } - - @Override - public String getReqPath() { - return getRootPath() + "/query"; - } - - @Override - public Map getQueryParams() { - return ImmutableMap.of("format", Collections.singletonList("resource")); - } - - @Override - public Object getRequestBody() { - return "{\"start\" : \"service-design-and-creation/models/\", \"query\" : \"query/serviceModels-byDistributionStatus?distributionStatus=DISTRIBUTION_COMPLETE_OK\"}"; - } - - public String getModelVersionId1() { - return modelVersionId1; - } - - public String getModelInvariantId() { - return modelInvariantId; - } - - -} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAICloudRegionAndSourceFromConfigurationPut.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAICloudRegionAndSourceFromConfigurationPut.java index c74cc0b14..66562ed63 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAICloudRegionAndSourceFromConfigurationPut.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAICloudRegionAndSourceFromConfigurationPut.java @@ -2,12 +2,11 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; - 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 class PresetAAICloudRegionAndSourceFromConfigurationPut extends BaseAAIPreset { @@ -64,9 +63,9 @@ public class PresetAAICloudRegionAndSourceFromConfigurationPut extends BaseAAIPr " \"results\": [{" + " \"id\": \"2979590232\"," + " \"node-type\": \"cloud-region\"," + - " \"url\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/att-aic/SDNO-S-BcloudReg-E1802\"," + + " \"url\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/SDNO-S-BcloudReg-E1802\"," + " \"properties\": {" + - " \"cloud-owner\": \"att-aic\"," + + " \"cloud-owner\": \"irma-aic\"," + " \"cloud-region-id\": \"" + getCloudRegionId() + "\"," + " \"sriov-automation\": false," + " \"resource-version\": \"1513631040564\"" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIFilterServiceInstanceById.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIFilterServiceInstanceById.java new file mode 100644 index 000000000..5fca9f392 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIFilterServiceInstanceById.java @@ -0,0 +1,39 @@ +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; + +public class PresetAAIFilterServiceInstanceById extends PresetAAIBaseSearchNodeQuery { + + private String subscriberId; + private String serviceType; + private String serviceInstanceId; + + public PresetAAIFilterServiceInstanceById(String subscriberId, String serviceType, String serviceInstanceId) { + this.subscriberId = subscriberId; + this.serviceType = serviceType; + this.serviceInstanceId = serviceInstanceId; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("search-node-type", Collections.singletonList("service-instance"), + "filter", Collections.singletonList("service-instance-id:EQUALS:" + this.serviceInstanceId)); + } + + @Override + public Object getResponseBody() { + return "" + + "{" + + "\"result-data\": [\n" + + " {\n" + + " \"resource-type\": \"service-instance\",\n" + + " \"resource-link\": \"/aai/v11/business/customers/customer/" + this.subscriberId + "/service-subscriptions/service-subscription/" + this.serviceType + "/service-instances/service-instance/" + this.serviceInstanceId + "\"\n" + + " }\n" + + " ]" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudOwnersByCloudRegionId.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudOwnersByCloudRegionId.java new file mode 100644 index 000000000..be075b481 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudOwnersByCloudRegionId.java @@ -0,0 +1,130 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.apache.commons.lang3.RandomStringUtils.randomNumeric; + +import com.google.common.collect.ImmutableMap; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +public class PresetAAIGetCloudOwnersByCloudRegionId extends BaseAAIPreset { + public static final String SOME_LEGACY_REGION = "some legacy region"; + public static final String JUST_ANOTHER_REGION = "just another region"; + public static final String MY_REGION = "my region"; + public static final String LCP_REGION_TEXT = "lcpRegionText"; + public static final String ATT_AIC = "irma-aic"; + public static final String MDT_1 = "mdt1"; + public static final String ATT_NC = "att-nc"; + public static final String hvf3 = "hvf3"; + public static final String olson3 = "olson3"; + public static final String olson5B = "olson5b"; + public static final String ATT_SABABA = "att-sababa"; + public static final String AAIAIC_25 = "JANET25"; + public static final String ONE = "One"; + public static final String hvf6 = "hvf6"; + private final String cloudRegionId; + private final String cloudOwner; + + //Since there is a cache of cloudRegionToCloudOwner, we can't have 2 preset of same cloud region that return different cloud owner. + //So all the preset instance must be declared here, for conflicts prevention. + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_SOME_LEGACY_REGION_TO_ATT_AIC = + new PresetAAIGetCloudOwnersByCloudRegionId(SOME_LEGACY_REGION, ATT_AIC); + + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_JUST_ANOTHER_REGION_TO_ATT_AIC = + new PresetAAIGetCloudOwnersByCloudRegionId(JUST_ANOTHER_REGION, ATT_AIC); + + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_MDT1_TO_ATT_NC = + new PresetAAIGetCloudOwnersByCloudRegionId(MDT_1, ATT_NC); + + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_RDM3_TO_ATT_NC = + new PresetAAIGetCloudOwnersByCloudRegionId(olson3, ATT_NC); + + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_MTN3_TO_ATT_SABABA = + new PresetAAIGetCloudOwnersByCloudRegionId(hvf3, ATT_SABABA); + + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_AAIAIC25_TO_ATT_AIC = + new PresetAAIGetCloudOwnersByCloudRegionId(AAIAIC_25, ATT_AIC); + + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_ONE_TO_ATT_AIC = + new PresetAAIGetCloudOwnersByCloudRegionId(ONE, ATT_AIC); + + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_MTN6_TO_ATT_AIC = + new PresetAAIGetCloudOwnersByCloudRegionId(hvf6, ATT_AIC); + + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_MY_REGION_TO_ATT_AIC = + new PresetAAIGetCloudOwnersByCloudRegionId(MY_REGION, ATT_AIC); + + public static final PresetAAIGetCloudOwnersByCloudRegionId PRESET_LCP_REGION_TEXT_TO_ATT_AIC = + new PresetAAIGetCloudOwnersByCloudRegionId(LCP_REGION_TEXT, ATT_AIC); + + private PresetAAIGetCloudOwnersByCloudRegionId(String cloudRegionId, String cloudOwnerResult) { + this.cloudRegionId = cloudRegionId; + this.cloudOwner = cloudOwnerResult; + } + + @Override + public Object getResponseBody() { + return "" + + "{" + + " \"cloud-region\": [{" + + " \"cloud-owner\": \"" + cloudOwner + "\"," + + " \"cloud-region-id\": \"" + cloudRegionId + "\"," + + " \"cloud-region-version\": \"2.5\"," + + " \"identity-url\": \"http://" + randomAlphabetic(5) + ":5000/v2.0\"," + + " \"complex-name\": \"" + cloudRegionId + "\"," + + " \"resource-version\": \"" + randomNumeric(5) + "\"," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"pserver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.LocatedIn\"," + + " \"related-link\": \"/aai/v12/cloud-infrastructure/pservers/pserver/" + randomAlphabetic(5) + "\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"pserver.hostname\"," + + " \"relationship-value\": \"" + randomAlphabetic(5) + "\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"pserver.pserver-name2\"" + + " }" + + " ]" + + " }, {" + + " \"related-to\": \"l3-network\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v12/network/l3-networks/l3-network/" + UUID.randomUUID() + "\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"l3-network.network-id\"," + + " \"relationship-value\": \"" + UUID.randomUUID() + "\"" + + " }" + + " ]," + + " \"related-to-property\": [{" + + " \"property-key\": \"l3-network.network-name\"," + + " \"property-value\": \"" + randomAlphabetic(5) + "\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + "}"; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/cloud-infrastructure/cloud-regions"; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("cloud-region-id", Collections.singletonList(cloudRegionId)); + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudRegionFromVnf.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudRegionFromVnf.java new file mode 100644 index 000000000..976228bf0 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetCloudRegionFromVnf.java @@ -0,0 +1,130 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import com.google.common.collect.ImmutableList; +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 class PresetAAIGetCloudRegionFromVnf extends BaseAAIPreset { + + private String vnfInstanceId; + + public PresetAAIGetCloudRegionFromVnf(String vnfInstanceId) { + this.vnfInstanceId = vnfInstanceId; + } + + public String getVnfInstanceId() { + return vnfInstanceId; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.PUT; + } + + @Override + public String getReqPath() { + return getRootPath() + "/query"; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of( + "format", Collections.singletonList("simple") + ); + } + + @Override + public Object getRequestBody() { + return ImmutableMap.of( + "start", ImmutableList.of("/network/generic-vnfs/generic-vnf/" + getVnfInstanceId()), + "query", "/query/cloud-region-fromVnf" + ); + } + + @Override + public Object getResponseBody() { + return "{" + + " \"results\": [" + + " {" + + " \"id\": \"363687968\"," + + " \"node-type\": \"generic-vnf\"," + + " \"url\": \"/aai/v14/network/generic-vnfs/generic-vnf/" + getVnfInstanceId() + "\"," + + " \"properties\": {" + + " \"vnf-id\": \"" + getVnfInstanceId() + "\"," + + " \"vnf-name\": \"zhvf23bmogx05_oam_01_rk\"," + + " \"vnf-type\": \"vMOG_SVC_UPDATED_FLAV_OAM/vMOG_VSP_UPDATED_FLAV 0\"," + + " \"service-id\": \"db171b8f-115c-4992-a2e3-ee04cae357e0\"," + + " \"prov-status\": \"NVTPROV\"," + + " \"orchestration-status\": \"Created\"," + + " \"in-maint\": false," + + " \"is-closed-loop-disabled\": false," + + " \"resource-version\": \"1522780608709\"," + + " \"model-invariant-id\": \"5108d7e4-f32a-44cd-8835-433a70915b8c\"," + + " \"model-version-id\": \"bae37933-b694-4b4e-a734-db63416f9cfe\"," + + " \"model-customization-id\": \"732305c6-d36a-47ee-a701-6f28f87b90cd\"," + + " \"nf-type\": \"POLICY\"," + + " \"nf-function\": \"Emanuel Orchestration Gateway (MOG)\"," + + " \"nf-role\": \"vMOG\"," + + " \"nf-naming-code\": \"\"" + + " }," + + " \"related-to\": [" + + " {" + + " \"id\": \"193753168\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.ComposedOf\"," + + " \"node-type\": \"service-instance\"," + + " \"url\": \"/aai/v14/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vMOG/service-instances/service-instance/7f10ffe2-548f-4168-8722-b782d05675b7\"" + + " }" + + " ]" + + " }," + + " {" + + " \"id\": \"8757432\"," + + " \"node-type\": \"tenant\"," + + " \"url\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/hvf23b/tenants/tenant/3e9a20a3e89e45f884e09df0cc2d2d2a\"," + + " \"properties\": {" + + " \"tenant-id\": \"3e9a20a3e89e45f884e09df0cc2d2d2a\"," + + " \"tenant-name\": \"APPC-24595-T-IST-02C\"," + + " \"resource-version\": \"1539855222745\"" + + " }," + + " \"related-to\": [" + + " {" + + " \"id\": \"264798392\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.BelongsTo\"," + + " \"node-type\": \"vserver\"," + + " \"url\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/hvf23b/tenants/tenant/3e9a20a3e89e45f884e09df0cc2d2d2a/vservers/vserver/088c2bf0-80e2-4bdf-93ae-b2469fbeba84\"" + + " }" + + " ]" + + " }," + + " {" + + " \"id\": \"302227536\"," + + " \"node-type\": \"cloud-region\"," + + " \"url\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/hvf23b\"," + + " \"properties\": {" + + " \"cloud-owner\": \"irma-aic\"," + + " \"cloud-region-id\": \"hvf23b\"," + + " \"cloud-type\": \"openstack\"," + + " \"owner-defined-type\": \"lcp\"," + + " \"cloud-region-version\": \"3.0\"," + + " \"identity-url\": \"https://iden.onap.org:5000/v2.0\"," + + " \"cloud-zone\": \"z1\"," + + " \"complex-name\": \"c1\"," + + " \"sriov-automation\": \"false\"," + + " \"resource-version\": \"1539855222969\"" + + " }," + + " \"related-to\": [" + + " {" + + " \"id\": \"2744328\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.BelongsTo\"," + + " \"node-type\": \"tenant\"," + + " \"url\": \"/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/hvf23b/tenants/tenant/5452d6bd0cb34e99a3553d349456c642\"" + + " }" + + " ]" + + " }" + + " ]" + + "}"; + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetHomingForVfModule.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetHomingForVfModule.java new file mode 100644 index 000000000..6b07f5293 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetHomingForVfModule.java @@ -0,0 +1,150 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +public class PresetAAIGetHomingForVfModule extends BaseAAIPreset { + private final String vnfInstanceId; + private final String vfModuleId; + private final String tenantId; + private final String lcpRegionId; + + public PresetAAIGetHomingForVfModule(String vnfInstanceId, String vfModuleId, String tenantId, String lcpRegionId) { + this.vnfInstanceId = vnfInstanceId; + this.vfModuleId = vfModuleId; + this.tenantId = tenantId; + this.lcpRegionId = lcpRegionId; + } + + public PresetAAIGetHomingForVfModule(String vnfInstanceId, String vfModuleId) { + this( + vnfInstanceId, + vfModuleId, + "db1818f7f2e34862b378bfb2cc520f91", + "olson5b" + ); + } + + public PresetAAIGetHomingForVfModule() { + this( + "0846287b-65bf-45a6-88f6-6a1af4149fac", + "a9b70ac0-5917-4203-a308-0e6920e6d09b", + "db1818f7f2e34862b378bfb2cc520f91", + "olson5b" + ); + } + + @Override + public Object getResponseBody() { + return "{" + + " \"vf-module-id\": \""+vfModuleId+"\"," + + " \"vf-module-name\": \"apndns_az_02_module_1\"," + + " \"heat-stack-id\": \"apndns_az_02_module_1/97a319f3-b095-4fff-befa-c657508ecaf8\"," + + " \"orchestration-status\": \"active\"," + + " \"is-base-vf-module\": false," + + " \"resource-version\": \"1530559380383\"," + + " \"model-invariant-id\": \"74450b48-0aa0-4743-8314-9163e92b7862\"," + + " \"model-version-id\": \"6bc01a2b-bc48-4991-b9fe-e22c2215d801\"," + + " \"model-customization-id\": \"74f638c2-0368-4212-8f73-e961005af17c\"," + + " \"module-index\": 0," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"l3-network\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.DependsOn\"," + + " \"related-link\": \"/aai/v12/network/l3-networks/l3-network/335e62be-73a3-41e8-930b-1a677bcafea5\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"l3-network.network-id\"," + + " \"relationship-value\": \"335e62be-73a3-41e8-930b-1a677bcafea5\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"l3-network.network-name\"," + + " \"property-value\": \"MNS-FN-25180-T-02Shared_oam_protected_net_1\"" + + " }" + + " ]" + + " }," + + " {" + + " \"related-to\": \"l3-network\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.DependsOn\"," + + " \"related-link\": \"/aai/v12/network/l3-networks/l3-network/2db4ee3e-2ac7-4fc3-8739-ecf53416459e\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"l3-network.network-id\"," + + " \"relationship-value\": \"2db4ee3e-2ac7-4fc3-8739-ecf53416459e\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"l3-network.network-name\"," + + " \"property-value\": \"Mobisupport-FN-27099-T-02_int_apn_dns_net_1\"" + + " }" + + " ]" + + " }," + + " {" + + " \"related-to\": \"volume-group\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/" + lcpRegionId + "/volume-groups/volume-group/66013ebe-0c81-44b9-a24f-7c6acba73a39\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"irma-aic\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"" + lcpRegionId + "\"" + + " }," + + " {" + + " \"relationship-key\": \"volume-group.volume-group-id\"," + + " \"relationship-value\": \"66013ebe-0c81-44b9-a24f-7c6acba73a39\"" + + " }" + + " ]" + + " }," + + " {" + + " \"related-to\": \"vserver\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/" + lcpRegionId + "/tenants/tenant/" + tenantId+ "/vservers/vserver/5eef9f6d-9933-4bc6-9a1a-862d61309437\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"irma-aic\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"" + lcpRegionId + "\"" + + " }," + + " {" + + " \"relationship-key\": \"tenant.tenant-id\"," + + " \"relationship-value\": \"" + tenantId + "\"" + + " }," + + " {" + + " \"relationship-key\": \"vserver.vserver-id\"," + + " \"relationship-value\": \"5eef9f6d-9933-4bc6-9a1a-862d61309437\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"vserver.vserver-name\"," + + " \"property-value\": \"zolson5bfapn01dns002\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + "}"; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/network/generic-vnfs/generic-vnf/" + this.vnfInstanceId + "/vf-modules/vf-module/" + this.vfModuleId; + } + + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegion.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegion.java index a50462a3d..9435dcd2b 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegion.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegion.java @@ -44,7 +44,7 @@ public class PresetAAIGetInstanceGroupsByCloudRegion extends BaseAAIPreset { public Object getRequestBody() { return ImmutableMap.of( "start", ImmutableList.of("cloud-infrastructure/cloud-regions/cloud-region/" + getCloudOwner() + "/" + getCloudRegionId()), - "query", "query/instance-group-byCloudRegion?type=" + type + "&role=" + role + "&function=" + getNetworkFunction() + "query", "query/instance-groups-byCloudRegion?type=" + type + "&role=" + role + "&function=" + getNetworkFunction() ); } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest.java index 9dae89be5..b20ef5a6e 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest.java @@ -44,7 +44,7 @@ public class PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest extends BaseA public Object getRequestBody() { return ImmutableMap.of( "start", ImmutableList.of("cloud-infrastructure/cloud-regions/cloud-region/" + getCloudOwner() + "/" + getCloudRegionId()), - "query", "query/instance-group-byCloudRegion?type=" + type + "&role=" + role + "&function=" + getNetworkFunction() + "query", "query/instance-groups-byCloudRegion?type=" + type + "&role=" + role + "&function=" + getNetworkFunction() ); } @@ -62,124 +62,124 @@ public class PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest extends BaseA @Override public Object getResponseBody() { - return "{\n" + - " \"results\": [\n" + - " {\n" + - " \"instance-group\": {\n" + - " \"instance-group-role\": \"JZmha7QSS4tJ\",\n" + - " \"some-filed\": \"some-data\",\n" + //extra field - " \"model-invariant-id\": \"model-id3\",\n" + - " \"model-version-id\": \"a0efd5fc-f7be-4502-936a-a6c6392b958f\",\n" + - " \"id\": \"AAI-12002-test3-vm230w\",\n" + - " \"description\": \"a9DEa0kpY\",\n" + - " \"instance-group-type\": \"type\",\n" + - " \"resource-version\": \"1520888659539\",\n" + - " \"instance-group-name\": \"wKmBXiO1xm8bK\",\n" + - " \"instance-group-function\": \"testfunction2\",\n" + - " \"relationship-list\": {\n" + - " \"relationship\": [\n" + - " {\n" + - " \"related-to\": \"cloud-region\",\n" + - " \"some-filed\": \"some-data\",\n" + //extra field - " \"relationship-label\": \"org.onap.relationships.inventory.Uses\",\n" + - " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\",\n" + - " \"relationship-data\": [\n" + - " {\n" + - " \"relationship-key\": \"cloud-region.cloud-owner\",\n" + - " \"relationship-value\": \"AAI-12002-vm230w\"\n" + - " },\n" + - " {\n" + - " \"relationship-key\": \"cloud-region.cloud-region-id\",\n" + - " \"relationship-value\": \"AAI-region-vm230w\"\n" + - " }\n" + - " ],\n" + - " \"related-to-property\": [\n" + - " {\n" + - " \"property-key\": \"cloud-region.owner-defined-type\"\n" + - " }\n" + - " ]\n" + - " }\n" + - " ]\n" + - " }\n" + - " }\n" + - " },\n" + - " {\n" + - " \"instance-group\": {\n" + - " \"instance-group-role\": \"JZmha7QSS4tJ\",\n" + - " \"model-invariant-id\": \"model-id1\",\n" + - " \"model-version-id\": \"a0efd5fc-f7be-4502-936a-a6c6392b958f\",\n" + - " \"id\": \"AAI-12002-test1-vm230w\",\n" + - " \"description\": \"a9DEa0kpY\",\n" + - " \"instance-group-type\": \"type\",\n" + - " \"resource-version\": \"1520886467989\",\n" + - " \"instance-group-name\": \"wKmBXiO1xm8bK\",\n" + - " \"instance-group-function\": \"testfunction2\",\n" + - " \"relationship-list\": {\n" + - " \"relationship\": [\n" + - " {\n" + - " \"related-to\": \"cloud-region\",\n" + - " \"relationship-label\": \"org.onap.relationships.inventory.Uses\",\n" + - " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\",\n" + - " \"relationship-data\": [\n" + - " {\n" + - " \"relationship-key\": \"cloud-region.cloud-owner\",\n" + - " \"some-filed\": \"some-data\",\n" + //extra field - " \"relationship-value\": \"AAI-12002-vm230w\"\n" + - " },\n" + - " {\n" + - " \"relationship-key\": \"cloud-region.cloud-region-id\",\n" + - " \"relationship-value\": \"AAI-region-vm230w\"\n" + - " }\n" + - " ],\n" + - " \"related-to-property\": [\n" + - " {\n" + - " \"property-key\": \"cloud-region.owner-defined-type\"\n" + - " }\n" + - " ]\n" + - " }\n" + - " ]\n" + - " }\n" + - " }\n" + - " },\n" + - " {\n" + - " \"instance-group\": {\n" + - " \"instance-group-role\": \"JZmha7QSS4tJ\",\n" + - " \"model-invariant-id\": \"model-id2\",\n" + - " \"model-version-id\": \"version2\",\n" + - " \"id\": \"AAI-12002-test2-vm230w\",\n" + - " \"description\": \"a9DEa0kpY\",\n" + - " \"instance-group-type\": \"type\",\n" + - " \"resource-version\": \"1520888629970\",\n" + - " \"instance-group-name\": \"wKmBXiO1xm8bK\",\n" + - " \"instance-group-function\": \"testfunction2\",\n" + - " \"relationship-list\": {\n" + - " \"relationship\": [\n" + - " {\n" + - " \"related-to\": \"cloud-region\",\n" + - " \"relationship-label\": \"org.onap.relationships.inventory.Uses\",\n" + - " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\",\n" + - " \"relationship-data\": [\n" + - " {\n" + - " \"relationship-key\": \"cloud-region.cloud-owner\",\n" + - " \"relationship-value\": \"AAI-12002-vm230w\"\n" + - " },\n" + - " {\n" + - " \"relationship-key\": \"cloud-region.cloud-region-id\",\n" + - " \"relationship-value\": \"AAI-region-vm230w\"\n" + - " }\n" + - " ],\n" + - " \"related-to-property\": [\n" + - " {\n" + - " \"property-key\": \"cloud-region.owner-defined-type\"\n" + - " }\n" + - " ]\n" + - " }\n" + - " ]\n" + - " }\n" + - " }\n" + - " }\n" + - " ]\n" + - "}\n"; + return "{" + + " \"results\": [" + + " {" + + " \"instance-group\": {" + + " \"instance-group-role\": \"JZmha7QSS4tJ\"," + + " \"some-filed\": \"some-data\"," + //extra field + " \"model-invariant-id\": \"model-id3\"," + + " \"model-version-id\": \"a0efd5fc-f7be-4502-936a-a6c6392b958f\"," + + " \"id\": \"AAI-12002-test3-vm230w\"," + + " \"description\": \"a9DEa0kpY\"," + + " \"instance-group-type\": \"type\"," + + " \"resource-version\": \"1520888659539\"," + + " \"instance-group-name\": \"wKmBXiO1xm8bK\"," + + " \"instance-group-function\": \"testfunction2\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"cloud-region\"," + + " \"some-filed\": \"some-data\"," + //extra field + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"AAI-12002-vm230w\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"AAI-region-vm230w\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"cloud-region.owner-defined-type\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " }," + + " {" + + " \"instance-group\": {" + + " \"instance-group-role\": \"JZmha7QSS4tJ\"," + + " \"model-invariant-id\": \"model-id1\"," + + " \"model-version-id\": \"a0efd5fc-f7be-4502-936a-a6c6392b958f\"," + + " \"id\": \"AAI-12002-test1-vm230w\"," + + " \"description\": \"a9DEa0kpY\"," + + " \"instance-group-type\": \"type\"," + + " \"resource-version\": \"1520886467989\"," + + " \"instance-group-name\": \"wKmBXiO1xm8bK\"," + + " \"instance-group-function\": \"testfunction2\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"cloud-region\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"some-filed\": \"some-data\"," + //extra field + " \"relationship-value\": \"AAI-12002-vm230w\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"AAI-region-vm230w\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"cloud-region.owner-defined-type\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " }," + + " {" + + " \"instance-group\": {" + + " \"instance-group-role\": \"JZmha7QSS4tJ\"," + + " \"model-invariant-id\": \"model-id2\"," + + " \"model-version-id\": \"version2\"," + + " \"id\": \"AAI-12002-test2-vm230w\"," + + " \"description\": \"a9DEa0kpY\"," + + " \"instance-group-type\": \"type\"," + + " \"resource-version\": \"1520888629970\"," + + " \"instance-group-name\": \"wKmBXiO1xm8bK\"," + + " \"instance-group-function\": \"testfunction2\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"cloud-region\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"AAI-12002-vm230w\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"AAI-region-vm230w\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"cloud-region.owner-defined-type\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " }" + + " ]" + + "}"; } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing.java index 4d596e527..eb4a22889 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing.java @@ -44,7 +44,7 @@ public class PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing extends Base public Object getRequestBody() { return ImmutableMap.of( "start", ImmutableList.of("cloud-infrastructure/cloud-regions/cloud-region/" + getCloudOwner() + "/" + getCloudRegionId()), - "query", "query/instance-group-byCloudRegion?type=" + type + "&role=" + role + "&function=" + getNetworkFunction() + "query", "query/instance-groups-byCloudRegion?type=" + type + "&role=" + role + "&function=" + getNetworkFunction() ); } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByOwningEntity.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByOwningEntity.java index 610ab6b48..41c35b8a5 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByOwningEntity.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByOwningEntity.java @@ -1,12 +1,11 @@ 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.Collections; import java.util.List; import java.util.Map; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; public class PresetAAIGetModelsByOwningEntity extends BaseAAIPreset { String oeName; @@ -45,11 +44,11 @@ public class PresetAAIGetModelsByOwningEntity extends BaseAAIPreset { " {" + " \"related-to\": \"service-instance\"," + " \"relationship-label\": \"org.onap.relationships.inventory.BelongsTo\"," + - " \"related-link\": \"/aai/v12/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/af9d52f9-13b2-4657-a198-463677f82dc0\"," + + " \"related-link\": \"/aai/v12/business/customers/customer/CAR_2020_ER/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/af9d52f9-13b2-4657-a198-463677f82dc0\"," + " \"relationship-data\": [" + " {" + " \"relationship-key\": \"customer.global-customer-id\"," + - " \"relationship-value\": \"MSO_1610_ST\"" + + " \"relationship-value\": \"CAR_2020_ER\"" + " }," + " {" + " \"relationship-key\": \"service-subscription.service-type\"," + @@ -70,11 +69,11 @@ public class PresetAAIGetModelsByOwningEntity extends BaseAAIPreset { " {" + " \"related-to\": \"service-instance\"," + " \"relationship-label\": \"org.onap.relationships.inventory.BelongsTo\"," + - " \"related-link\": \"/aai/v12/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/49769492-5def-4c89-8e73-b236f958fa40\"," + + " \"related-link\": \"/aai/v12/business/customers/customer/CAR_2020_ER/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/49769492-5def-4c89-8e73-b236f958fa40\"," + " \"relationship-data\": [" + " {" + " \"relationship-key\": \"customer.global-customer-id\"," + - " \"relationship-value\": \"MSO_1610_ST\"" + + " \"relationship-value\": \"CAR_2020_ER\"" + " }," + " {" + " \"relationship-key\": \"service-subscription.service-type\"," + @@ -120,7 +119,7 @@ public class PresetAAIGetModelsByOwningEntity extends BaseAAIPreset { " {" + " \"related-to\": \"service-instance\"," + " \"relationship-label\": \"org.onap.relationships.inventory.BelongsTo\"," + - " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Mobility/service-instances/service-instance/7e4f8130-5dee-47c4-8770-1abc5f5ded83\"," + + " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/7e4f8130-5dee-47c4-8770-1abc5f5ded83\"," + " \"relationship-data\": [" + " {" + " \"relationship-key\": \"customer.global-customer-id\"," + @@ -128,7 +127,7 @@ public class PresetAAIGetModelsByOwningEntity extends BaseAAIPreset { " }," + " {" + " \"relationship-key\": \"service-subscription.service-type\"," + - " \"relationship-value\": \"Mobility\"" + + " \"relationship-value\": \"Emanuel\"" + " }," + " {" + " \"relationship-key\": \"service-instance.service-instance-id\"," + @@ -145,7 +144,7 @@ public class PresetAAIGetModelsByOwningEntity extends BaseAAIPreset { " {" + " \"related-to\": \"service-instance\"," + " \"relationship-label\": \"org.onap.relationships.inventory.BelongsTo\"," + - " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Mobility/service-instances/service-instance/d849b312-03f6-4fa3-a923-a469b850ec73\"," + + " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/d849b312-03f6-4fa3-a923-a469b850ec73\"," + " \"relationship-data\": [" + " {" + " \"relationship-key\": \"customer.global-customer-id\"," + @@ -153,7 +152,7 @@ public class PresetAAIGetModelsByOwningEntity extends BaseAAIPreset { " }," + " {" + " \"relationship-key\": \"service-subscription.service-type\"," + - " \"relationship-value\": \"Mobility\"" + + " \"relationship-value\": \"Emanuel\"" + " }," + " {" + " \"relationship-key\": \"service-instance.service-instance-id\"," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByProject.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByProject.java index 96372abb4..cb80fd6ce 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByProject.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetModelsByProject.java @@ -1,13 +1,12 @@ 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.Collections; import java.util.List; import java.util.Map; import java.util.UUID; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; public class PresetAAIGetModelsByProject extends BaseAAIPreset { private String projectName; @@ -49,7 +48,7 @@ public class PresetAAIGetModelsByProject extends BaseAAIPreset { " {" + " \"related-to\": \"service-instance\"," + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + - " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Mobility/service-instances/service-instance/3f826016-3ac9-4928-9561-beee75fd91d5\"," + + " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/3f826016-3ac9-4928-9561-beee75fd91d5\"," + " \"relationship-data\": [" + " {" + " \"relationship-key\": \"customer.global-customer-id\"," + @@ -57,7 +56,7 @@ public class PresetAAIGetModelsByProject extends BaseAAIPreset { " }," + " {" + " \"relationship-key\": \"service-subscription.service-type\"," + - " \"relationship-value\": \"Mobility\"" + + " \"relationship-value\": \"Emanuel\"" + " }," + " {" + " \"relationship-key\": \"service-instance.service-instance-id\"," + @@ -124,7 +123,7 @@ public class PresetAAIGetModelsByProject extends BaseAAIPreset { " {" + " \"related-to\": \"service-instance\"," + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + - " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Mobility/service-instances/service-instance/ff2d9326-1ef5-4760-aba0-0eaf372ae675\"," + + " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/ff2d9326-1ef5-4760-aba0-0eaf372ae675\"," + " \"relationship-data\": [" + " {" + " \"relationship-key\": \"customer.global-customer-id\"," + @@ -132,7 +131,7 @@ public class PresetAAIGetModelsByProject extends BaseAAIPreset { " }," + " {" + " \"relationship-key\": \"service-subscription.service-type\"," + - " \"relationship-value\": \"Mobility\"" + + " \"relationship-value\": \"Emanuel\"" + " }," + " {" + " \"relationship-key\": \"service-instance.service-instance-id\"," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetMultipleVersion.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetMultipleVersion.java deleted file mode 100644 index a9c63196a..000000000 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetMultipleVersion.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.onap.simulator.presetGenerator.presets.aai; - -public class PresetAAIGetMultipleVersion extends BasePresetAAIGetVersion { - public String modelVersionId2; - public String modelVersionId3; - public PresetAAIGetMultipleVersion(String modelVersionId1, - String modelVersionId2, - String modelVersionId3, - String modelInvariantId) { - super( modelVersionId1, modelInvariantId); - this.modelVersionId2 = modelVersionId2; - this.modelVersionId3 = modelVersionId3; - } - public String getModelVersionId2() { - return modelVersionId2; - } - public String getModelVersionId3() { - return modelVersionId3; - } - - @Override - public Object getResponseBody() { - return "{\"results\": [" + - " {" + - " \"model\": {" + - " \"model-invariant-id\": \"" + getModelInvariantId() + "\"," + - " \"model-type\": \"resource\"," + - " \"resource-version\": \"1500138206526\"," + - " \"model-vers\": {" + - " \"model-ver\": [" + - " {" + - " \"model-version-id\": \"" + getModelVersionId1() + "\"," + - " \"model-name\": \"action-data\"," + - " \"model-version\": \"1.0\"," + - " \"model-description\": \"decontamination arm circus ammonia hump edge\"," + - " \"resource-version\": \"1500137463984\"" + - " }," + - " {" + - " \"model-version-id\": \"" + getModelVersionId3() + "\"," + - " \"model-name\": \"action-data\"," + - " \"model-version\": \"3.0\"," + - " \"model-description\": \"Non decontamination arm circus ammonia hump edge\"," + - " \"resource-version\": \"1500137463986\"" + - " }," + - " {" + - " \"model-version-id\": \"" + getModelVersionId2() + "\"," + - " \"model-name\": \"action-data\"," + - " \"model-version\": \"2.0\"," + - " \"model-description\": \"The oldest one\"," + - " \"resource-version\": \"1500137463980\"" + - " }" + - " ]" + - " }" + - " }" + - " }" + - " ]}"; - } - - } \ No newline at end of file diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetails.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetails.java index e1fa74ec8..b99f58bda 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetails.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetails.java @@ -2,12 +2,11 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; - 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 class PresetAAIGetNetworkCollectionDetails extends BaseAAIPreset { @@ -219,10 +218,11 @@ public class PresetAAIGetNetworkCollectionDetails extends BaseAAIPreset { " \"network-id\": \"l3network-id-rs804s\",\n" + " \"network-name\": \"oam-net\",\n" + " \"network-type\": \"Tenant_Layer_3\",\n" + - " \"network-role\": \"HngwProtectedOam.OAM\",\n" + + " \"network-role\": \"RosemaProtectedOam.OAM\",\n" + " \"network-technology\": \"Contrail\",\n" + " \"is-bound-to-vpn\": false,\n" + " \"resource-version\": \"1521662814627\",\n" + + " \"orchestration-status\": \"Created\",\n" + " \"is-provider-network\": false,\n" + " \"is-shared-network\": false,\n" + " \"is-external-network\": false,\n" + @@ -258,10 +258,11 @@ public class PresetAAIGetNetworkCollectionDetails extends BaseAAIPreset { " \"network-id\": \"l3network-id-3-rs804s\",\n" + " \"network-name\": \"oam-net\",\n" + " \"network-type\": \"Tenant_Layer_3\",\n" + - " \"network-role\": \"HngwProtectedOam.OAM\",\n" + + " \"network-role\": \"RosemaProtectedOam.OAM\",\n" + " \"network-technology\": \"Contrail\",\n" + " \"is-bound-to-vpn\": false,\n" + " \"resource-version\": \"1521662816043\",\n" + + " \"orchestration-status\": \"Created\",\n" + " \"is-provider-network\": false,\n" + " \"is-shared-network\": false,\n" + " \"is-external-network\": false,\n" + @@ -297,10 +298,11 @@ public class PresetAAIGetNetworkCollectionDetails extends BaseAAIPreset { " \"network-id\": \"l3network-id-2-rs804s\",\n" + " \"network-name\": \"oam-net\",\n" + " \"network-type\": \"Tenant_Layer_3\",\n" + - " \"network-role\": \"HngwProtectedOam.OAM\",\n" + + " \"network-role\": \"RosemaProtectedOam.OAM\",\n" + " \"network-technology\": \"Contrail\",\n" + " \"is-bound-to-vpn\": false,\n" + " \"resource-version\": \"1521662815304\",\n" + + " \"orchestration-status\": \"Created\",\n" + " \"is-provider-network\": false,\n" + " \"is-shared-network\": false,\n" + " \"is-external-network\": false,\n" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsInvalidRequest.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsInvalidRequest.java index d0e4baf60..0d447c2c2 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsInvalidRequest.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsInvalidRequest.java @@ -2,12 +2,11 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; - 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 class PresetAAIGetNetworkCollectionDetailsInvalidRequest extends BaseAAIPreset { @@ -221,11 +220,12 @@ public class PresetAAIGetNetworkCollectionDetailsInvalidRequest extends BaseAAIP " \"network-id\": \"l3network-id-rs804s\",\n" + " \"network-name\": \"oam-net\",\n" + " \"network-type\": \"Tenant_Layer_3\",\n" + - " \"network-role\": \"HngwProtectedOam.OAM\",\n" + - " \"network-roles\": \"HngwProtectedOam.OAM\",\n" +//extra field + " \"network-role\": \"RosemaProtectedOam.OAM\",\n" + + " \"network-roles\": \"RosemaProtectedOam.OAM\",\n" +//extra field " \"network-technology\": \"Contrail\",\n" + " \"is-bound-to-vpn\": false,\n" + " \"resource-version\": \"1521662814627\",\n" + + " \"orchestration-status\": \"Created\",\n" + " \"is-provider-network\": false,\n" + " \"is-shared-network\": false,\n" + " \"is-external-network\": false,\n" + @@ -261,10 +261,11 @@ public class PresetAAIGetNetworkCollectionDetailsInvalidRequest extends BaseAAIP " \"network-id\": \"l3network-id-3-rs804s\",\n" + " \"network-name\": \"oam-net\",\n" + " \"network-type\": \"Tenant_Layer_3\",\n" + - " \"network-role\": \"HngwProtectedOam.OAM\",\n" + + " \"network-role\": \"RosemaProtectedOam.OAM\",\n" + " \"network-technology\": \"Contrail\",\n" + " \"is-bound-to-vpn\": false,\n" + " \"resource-version\": \"1521662816043\",\n" + + " \"orchestration-status\": \"Created\",\n" + " \"is-provider-network\": false,\n" + " \"is-shared-network\": false,\n" + " \"is-external-network\": false,\n" + @@ -300,10 +301,11 @@ public class PresetAAIGetNetworkCollectionDetailsInvalidRequest extends BaseAAIP " \"network-id\": \"l3network-id-2-rs804s\",\n" + " \"network-name\": \"oam-net\",\n" + " \"network-type\": \"Tenant_Layer_3\",\n" + - " \"network-role\": \"HngwProtectedOam.OAM\",\n" + + " \"network-role\": \"RosemaProtectedOam.OAM\",\n" + " \"network-technology\": \"Contrail\",\n" + " \"is-bound-to-vpn\": false,\n" + " \"resource-version\": \"1521662815304\",\n" + + " \"orchestration-status\": \"Created\",\n" + " \"is-provider-network\": false,\n" + " \"is-shared-network\": false,\n" + " \"is-external-network\": false,\n" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsRequiredMissing.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsRequiredMissing.java index c32a3b563..23b35d204 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsRequiredMissing.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkCollectionDetailsRequiredMissing.java @@ -2,12 +2,11 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; - 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 class PresetAAIGetNetworkCollectionDetailsRequiredMissing extends BaseAAIPreset { @@ -218,7 +217,7 @@ public class PresetAAIGetNetworkCollectionDetailsRequiredMissing extends BaseAAI " \"network-id\": \"l3network-id-rs804s\",\n" + " \"network-name\": \"oam-net\",\n" + " \"network-type\": \"Tenant_Layer_3\",\n" + - " \"network-role\": \"HngwProtectedOam.OAM\",\n" + + " \"network-role\": \"RosemaProtectedOam.OAM\",\n" + " \"network-technology\": \"Contrail\",\n" + " \"is-bound-to-vpn\": false,\n" + " \"resource-version\": \"1521662814627\",\n" + @@ -257,7 +256,7 @@ public class PresetAAIGetNetworkCollectionDetailsRequiredMissing extends BaseAAI " \"network-id\": \"l3network-id-3-rs804s\",\n" + " \"network-name\": \"oam-net\",\n" + " \"network-type\": \"Tenant_Layer_3\",\n" + - " \"network-role\": \"HngwProtectedOam.OAM\",\n" + + " \"network-role\": \"RosemaProtectedOam.OAM\",\n" + " \"network-technology\": \"Contrail\",\n" + " \"is-bound-to-vpn\": false,\n" + " \"resource-version\": \"1521662816043\",\n" + @@ -296,7 +295,7 @@ public class PresetAAIGetNetworkCollectionDetailsRequiredMissing extends BaseAAI " \"network-id\": \"l3network-id-2-rs804s\",\n" + " \"network-name\": \"oam-net\",\n" + " \"network-type\": \"Tenant_Layer_3\",\n" + - " \"network-role\": \"HngwProtectedOam.OAM\",\n" + + " \"network-role\": \"RosemaProtectedOam.OAM\",\n" + " \"network-technology\": \"Contrail\",\n" + " \"is-bound-to-vpn\": false,\n" + " \"resource-version\": \"1521662815304\",\n" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkZones.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkZones.java index e8449b320..93f8ad8ab 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkZones.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetNetworkZones.java @@ -721,8 +721,8 @@ public class PresetAAIGetNetworkZones extends BaseAAIPreset { " \"zone-name\": \"QWERTYUI-NUM1\"" + " }," + " {" + - " \"zone-id\": \"MTN32\"," + - " \"zone-name\": \"MDTWNJ21-MTN32\"" + + " \"zone-id\": \"hvf32\"," + + " \"zone-name\": \"MDTWNJ21-hvf32\"" + " }," + " {" + " \"zone-id\": \"RTZ4\"," + @@ -773,8 +773,8 @@ public class PresetAAIGetNetworkZones extends BaseAAIPreset { " \"zone-name\": \"ATLSECIA-ABC12\"" + " }," + " {" + - " \"zone-id\": \"MTN20\"," + - " \"zone-name\": \"MDTWNJ21-MTN20\"" + + " \"zone-id\": \"hvf20\"," + + " \"zone-name\": \"MDTWNJ21-hvf20\"" + " }," + " {" + " \"zone-id\": \"ABC15\"," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetOneVersion.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetOneVersion.java deleted file mode 100644 index 74e2102f1..000000000 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetOneVersion.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.onap.simulator.presetGenerator.presets.aai; - -public class PresetAAIGetOneVersion extends BasePresetAAIGetVersion { - - public PresetAAIGetOneVersion(String modelVersionId1, - String modelInvariantId) { - super(modelVersionId1, modelInvariantId); - } - - @Override - public Object getResponseBody() { - return "{\"results\": [" + - " {" + - " \"model\": {" + - " \"model-invariant-id\": \"" + getModelInvariantId() + "\"," + - " \"model-type\": \"resource\"," + - " \"resource-version\": \"1500138206526\"," + - " \"model-vers\": {" + - " \"model-ver\": [" + - " {" + - " \"model-version-id\": \"" + getModelVersionId1() + "\"," + - " \"model-name\": \"action-data\"," + - " \"model-version\": \"1.0\"," + - " \"model-description\": \"decontamination arm circus ammonia hump edge\"," + - " \"resource-version\": \"1500137463984\"" + - " }" + - " ]" + - " }" + - " }" + - " }" + - " ]}"; - } -} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPNFByRegionErrorPut.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPNFByRegionErrorPut.java index d363619e5..0676217a1 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPNFByRegionErrorPut.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPNFByRegionErrorPut.java @@ -12,7 +12,7 @@ public class PresetAAIGetPNFByRegionErrorPut extends BaseAAIPreset { public Object getResponseBody() { return "{" + " \"start\": \"/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89/service-subscriptions/service-subscription/VIRTUAL%20USP/service-instances?model-version-id=8a84e59b-45fe-4851-8ff1-34225a0b32c3&model-invariant-id=83b458fd-5dd3-419b-a9e3-7335814a0911\"," + - " \"query\": \"query/pnf-fromModel-byRegion?cloudRegionId=AAIAIC25&equipVendor=Cisco&equipModel=Nexus%203048-TP\"" + + " \"query\": \"query/pnf-fromModel-byRegion?cloudRegionId=JANET25&equipVendor=Cisco&equipModel=Nexus%203048-TP\"" + " }"; } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPortMirroringSourcePorts.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPortMirroringSourcePorts.java index a95df4592..fdb387d71 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPortMirroringSourcePorts.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetPortMirroringSourcePorts.java @@ -1,12 +1,11 @@ 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.Collections; import java.util.List; import java.util.Map; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; public class PresetAAIGetPortMirroringSourcePorts extends BaseAAIPreset { public PresetAAIGetPortMirroringSourcePorts(String configurationId, String interfaceId, String interfaceName, boolean isPortMirrored) { @@ -64,10 +63,10 @@ public class PresetAAIGetPortMirroringSourcePorts extends BaseAAIPreset { " {\n" + " \"id\": \"4876980240\",\n" + " \"node-type\": \"l-interface\",\n" + - " \"url\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/att-aic/rdm5b/tenants/tenant/460f35aeb53542dc9f77105066483e83/vservers/vserver/15e46e2f-4b98-4e06-9644-f0e6e35cc79a/l-interfaces/l-interface/zrdm5bfprbVLBA005-vlbagent_aff_int_pktmirror_1_port-dr5jhyxva5ib\",\n" + + " \"url\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson5b/tenants/tenant/460f35aeb53542dc9f77105066483e83/vservers/vserver/15e46e2f-4b98-4e06-9644-f0e6e35cc79a/l-interfaces/l-interface/zolson5bfprbVLBA005-vlbagent_aff_int_pktmirror_1_port-dr5jhyxva5ib\",\n" + " \"properties\": {\n" + " \"interface-name\": " + doubleQuoteIfNotNull(getInterfaceName()) + ",\n" + - " \"selflink\": \"https://network-aic.rdm5b.cci.att.com:9696/v2.0/ports/6de7bf87-6faa-4984-9492-18d1188b3d4a\",\n" + + " \"selflink\": \"https://netw.onap.org:9696/v2.0/ports/6de7bf87-6faa-4984-9492-18d1188b3d4a\",\n" + " \"interface-id\": " + doubleQuoteIfNotNull(getInterfaceId()) + ",\n" + " \"macaddr\": \"02:6d:e7:bf:87:6f\",\n" + " \"network-name\": \"APP-C-24595-D-T001-vprobe_int_pktmirror_net_1\",\n" + @@ -81,7 +80,7 @@ public class PresetAAIGetPortMirroringSourcePorts extends BaseAAIPreset { " \"id\": \"4999893128\",\n" + " \"relationship-label\": \"org.onap.relationships.inventory.BelongsTo\",\n" + " \"node-type\": \"l3-interface-ipv4-address-list\",\n" + - " \"url\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/att-aic/rdm5b/tenants/tenant/460f35aeb53542dc9f77105066483e83/vservers/vserver/15e46e2f-4b98-4e06-9644-f0e6e35cc79a/l-interfaces/l-interface/zrdm5bfprbVLBA005-vlbagent_aff_int_pktmirror_1_port-dr5jhyxva5ib/l3-interface-ipv4-address-list/107.244.46.254\"\n" + + " \"url\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson5b/tenants/tenant/460f35aeb53542dc9f77105066483e83/vservers/vserver/15e46e2f-4b98-4e06-9644-f0e6e35cc79a/l-interfaces/l-interface/zolson5bfprbVLBA005-vlbagent_aff_int_pktmirror_1_port-dr5jhyxva5ib/l3-interface-ipv4-address-list/107.244.46.254\"\n" + " },\n" + " {\n" + " \"id\": \"6150074384\",\n" + @@ -111,7 +110,7 @@ public class PresetAAIGetPortMirroringSourcePorts extends BaseAAIPreset { " \"id\": \"5491453960\",\n" + " \"relationship-label\": \"tosca.relationships.network.BindsTo\",\n" + " \"node-type\": \"vserver\",\n" + - " \"url\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/att-aic/rdm5b/tenants/tenant/460f35aeb53542dc9f77105066483e83/vservers/vserver/15e46e2f-4b98-4e06-9644-f0e6e35cc79a\"\n" + + " \"url\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson5b/tenants/tenant/460f35aeb53542dc9f77105066483e83/vservers/vserver/15e46e2f-4b98-4e06-9644-f0e6e35cc79a\"\n" + " }\n" + " ]\n" + " }\n" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetRelatedInstanceGroupsByVnfId.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetRelatedInstanceGroupsByVnfId.java index 97186c9da..da1a120b4 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetRelatedInstanceGroupsByVnfId.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetRelatedInstanceGroupsByVnfId.java @@ -1,12 +1,11 @@ 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.Collections; import java.util.List; import java.util.Map; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; public class PresetAAIGetRelatedInstanceGroupsByVnfId extends BaseAAIPreset { @@ -47,7 +46,7 @@ public class PresetAAIGetRelatedInstanceGroupsByVnfId extends BaseAAIPreset { public Object getResponseBody() { return "{\n" + " \"vnf-id\": \"vnf-id-3\",\n" + - " \"vnf-name\": \"zmtn6nf-code-110\",\n" + + " \"vnf-name\": \"zhvf6nf-code-110\",\n" + " \"vnf-type\": \"vnf-type\",\n" + " \"prov-status\": \"NVTPROV\",\n" + " \"operational-status\": \"out-of-service-path\",\n" + @@ -106,15 +105,15 @@ public class PresetAAIGetRelatedInstanceGroupsByVnfId extends BaseAAIPreset { " {\n" + " \"related-to\": \"availability-zone\",\n" + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\",\n" + - " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6/availability-zones/availability-zone/AZ-MN02\",\n" + + " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/hvf6/availability-zones/availability-zone/AZ-MN02\",\n" + " \"relationship-data\": [\n" + " {\n" + " \"relationship-key\": \"cloud-region.cloud-owner\",\n" + - " \"relationship-value\": \"att-aic\"\n" + + " \"relationship-value\": \"irma-aic\"\n" + " },\n" + " {\n" + " \"relationship-key\": \"cloud-region.cloud-region-id\",\n" + - " \"relationship-value\": \"mtn6\"\n" + + " \"relationship-value\": \"hvf6\"\n" + " },\n" + " {\n" + " \"relationship-key\": \"availability-zone.availability-zone-name\",\n" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServiceInstancesByInvariantId.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServiceInstancesByInvariantId.java new file mode 100644 index 000000000..8f7b6d0fb --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServiceInstancesByInvariantId.java @@ -0,0 +1,90 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Multimap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class PresetAAIGetServiceInstancesByInvariantId extends BaseAAIPreset { + + private String globalCustomerId; + private String serviceType; + private String invariantId; + private Map> servicesWithRelationships; + + public PresetAAIGetServiceInstancesByInvariantId(String globalCustomerId, String serviceType, String invariantId, + Map> servicesWithRelationships) { + this.globalCustomerId = globalCustomerId; + this.serviceType = serviceType; + this.invariantId = invariantId; + this.servicesWithRelationships = servicesWithRelationships; + } + + @Override + public String getResponseBody() { + return "{" + + " \"service-instance\":[" + + servicesWithRelationships.entrySet().stream().map( + entry -> buildServiceInstance(entry.getKey(), entry.getValue()) + ).collect(Collectors.joining(",")) + + " ]" + + "}"; + } + + private String buildServiceInstance(String serviceInstanceId, Multimap relationships) { + return " {" + + " \"service-instance-id\":\"" + serviceInstanceId + "\"," + + " \"service-instance-name\":\"service-instance-name\"," + + " \"service-instance-type\":\"service-instance-type\"," + + " \"service-instance-role\":\"service-instance-role\"," + + " \"model-invariant-id\":\"" + invariantId + "\"," + + " \"model-version-id\":\"7a6ee536-f052-46fa-aa7e-2fca9d674c44\"," + + " \"resource-version\":\"GARBAGE DATA\"," + + " \"orchestration-status\":\"GARBAGE DATA\"," + + " \"relationship-list\":{" + + " \"relationship\":[" + + relationships.entries().stream().map( + entry -> buildRelationship(entry.getKey(), entry.getValue()) + ).collect(Collectors.joining(",")) + + " ]" + + " }" + + " }"; + } + + private String buildRelationship(String relatedTo, final String relatedLink) { + return "" + + "{ " + + " \"related-to\": \"" + relatedTo + "\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.ComposedOf\", " + + " \"related-link\": \"" + relatedLink + "\", " + + " \"relationship-data\": [" + + " { " + + " \"relationship-key\": \"GARBAGE DATA\", " + + " \"relationship-value\": \"GARBAGE DATA\" " + + " } " + + " ] " + + "}"; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/business/customers/customer/" + + globalCustomerId + "/service-subscriptions/service-subscription/" + + serviceType + "/service-instances"; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("model-invariant-id", ImmutableList.of(invariantId)); + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServiceModelList.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServiceModelList.java deleted file mode 100644 index e99630639..000000000 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServiceModelList.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.onap.simulator.presetGenerator.presets.aai; - -public class PresetAAIGetServiceModelList extends BasePresetAAIGetVersion { - - public String modelInvariant2; - public String modelInvariant3; - public PresetAAIGetServiceModelList(String modelVersionId1, - String modelInvariantId1, String modelInvariant2, String modelInvariant3) { - super(modelVersionId1, modelInvariantId1); - this.modelInvariant2 = modelInvariant2; - this.modelInvariant3 = modelInvariant3; - } - - public String getModelInvariant2() { - return modelInvariant2; - } - - public void setModelInvariant2(String modelInvariant2) { - this.modelInvariant2 = modelInvariant2; - } - - public String getModelInvariant3() { - return modelInvariant3; - } - - public void setModelInvariant3(String modelInvariant3) { - this.modelInvariant3 = modelInvariant3; - } - - @Override - public Object getResponseBody() { - return "{\n" + - "\"results\": [\n" + - " {\"model\": { \n" + - " \"model-invariant-id\": \"" + getModelInvariantId() + "\"," + - " \"model-type\": \"service\",\n" + - " \"resource-version\": \"1515103312329\",\n" + - " \"model-vers\": {\"model-ver\": [\n" + - " {\n" + - " \"model-version-id\": \"" + getModelVersionId1() + "\"," + - " \"model-name\": \"AAAvIRC_mm779p_Service\",\n" + - " \"model-version\": \"1.0\",\n" + - " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\",\n" + - " \"model-description\": \"tbd\",\n" + - " \"resource-version\": \"1516206395612\"\n" + - " }\n" + - " ]}\n" + - " }},\n" + - " {\"model\": { \n" + - " \"model-invariant-id\": \"" + getModelInvariant2() + "\"," + - " \"model-type\": \"service\",\n" + - " \"resource-version\": \"1515103312329\",\n" + - " \"model-vers\": {\"model-ver\": [\n" + - " {\n" + - " \"model-version-id\": \"1dae721c-a1ef-435f-b811-760c23f467bf\",\n" + - " \"model-name\": \"BBBvIRC_mm779p_Service\",\n" + - " \"model-version\": \"3.0\",\n" + - " \"model-description\": \"tbd\",\n" + - " \"resource-version\": \"1516025197086\"\n" + - " }\n" + - " ]}\n" + - " }},\n" + - " {\"model\": { \n" + - " \"model-invariant-id\": \"" + getModelInvariant3() + "\"," + - " \"model-type\": \"service\",\n" + - " \"resource-version\": \"1515103312329\",\n" + - " \"model-vers\": {\"model-ver\": [\n" + - "{\n" + - " \"model-version-id\": \"29236d45-e790-4c17-a115-1533cc09b7b1\",\n" + - " \"model-name\": \"CCCvIRC_mm779p_Service\",\n" + - " \"model-version\": \"4.0\",\n" + - " \"distribution-status\": \"DISTRIBUTION_COMPLETE_ERROR\",\n" + - " \"model-description\": \"tbd\",\n" + - " \"resource-version\": \"1517319724440\"\n" + - " }\n" + - " ]}\n" + - " }}\n" + - "]}\n"; - } -} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServicesGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServicesGet.java index 04cef06ad..615879e18 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServicesGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetServicesGet.java @@ -29,18 +29,18 @@ public class PresetAAIGetServicesGet extends PresetAAIBaseGetServicesGet { " \"resource-version\":\"1494001980153\"" + " }," + " {" + - " \"service-id\":\"vRRaaS\"," + - " \"service-description\":\"vRRaaS\"," + + " \"service-id\":\"vTerrance\"," + + " \"service-description\":\"vTerrance\"," + " \"resource-version\":\"1484865266\"" + " }," + " {" + " \"service-id\":\"323d69d9-2efe-4r45-ay0a-89ea7ard4e6f\"," + - " \"service-description\":\"vSCP\"," + + " \"service-description\":\"vEsmeralda\"," + " \"resource-version\":\"1494001903012\"" + " }," + " {" + " \"service-id\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"," + - " \"service-description\":\"Mobility\"," + + " \"service-description\":\"Emanuel\"," + " \"resource-version\":\"1503954056794\"" + " }," + " {" + @@ -59,18 +59,18 @@ public class PresetAAIGetServicesGet extends PresetAAIBaseGetServicesGet { " \"resource-version\":\"1494001863930\"" + " }," + " {" + - " \"service-id\":\"vHNGWaas\"," + + " \"service-id\":\"vRosemarie\"," + " \"service-description\":\"HNGATEWAY\"," + " \"resource-version\":\"1501192849249\"" + " }," + " {" + " \"service-id\":\"vHNPaas\"," + - " \"service-description\":\"HNPORTAL\"," + + " \"service-description\":\"WILKINS\"," + " \"resource-version\":\"1501192982895\"" + " }," + " {" + " \"service-id\":\"e433710f-9217-458d-a79d-1c7aff376d89\"," + - " \"service-description\":\"VIRTUAL USP\"," + + " \"service-description\":\"TYLER SILVIA\"," + " \"resource-version\":\"1494001802638\"" + " }," + " {" + @@ -79,8 +79,8 @@ public class PresetAAIGetServicesGet extends PresetAAIBaseGetServicesGet { " \"resource-version\":\"1492533254036\"" + " }," + " {" + - " \"service-id\":\"VIPRaaS\"," + - " \"service-description\":\"vIPRaaS\"," + + " \"service-id\":\"vMuriel\"," + + " \"service-description\":\"vMuriel\"," + " \"resource-version\":\"1490910058887\"" + " }," + " {" + @@ -99,8 +99,8 @@ public class PresetAAIGetServicesGet extends PresetAAIBaseGetServicesGet { " \"resource-version\":\"1506361785997\"" + " }," + " {" + - " \"service-id\":\"vVIGaaS\"," + - " \"service-description\":\"vVIGaaS\"," + + " \"service-id\":\"vSalvatore\"," + + " \"service-description\":\"vSalvatore\"," + " \"resource-version\":\"1494001900545\"" + " }," + " {" + @@ -109,8 +109,8 @@ public class PresetAAIGetServicesGet extends PresetAAIBaseGetServicesGet { " \"resource-version\":\"1494001941772\"" + " }," + " {" + - " \"service-id\":\"vPEaaS\"," + - " \"service-description\":\"vPEaaS\"," + + " \"service-id\":\"vHubbard\"," + + " \"service-description\":\"vHubbard\"," + " \"resource-version\":\"1494001988229\"" + " }," + " {" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java index 3033c027f..db41b9518 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java @@ -1,13 +1,13 @@ package org.onap.simulator.presetGenerator.presets.aai; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.springframework.http.HttpMethod; +import static vid.automation.test.utils.ReadFile.loadResourceAsString; +import com.google.common.collect.ImmutableMap; import java.util.Collections; import java.util.List; import java.util.Map; - -import static vid.automation.test.utils.ReadFile.loadResourceAsString; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; public class PresetAAIGetSubDetailsGet extends BaseAAIPreset { private String subscriberId; @@ -15,14 +15,23 @@ public class PresetAAIGetSubDetailsGet extends BaseAAIPreset { private static final String baseResponseBody = loadResourceAsString("presets_templates/PresetAAIGetSubDetailsGet.json"); private static final String GLOBAL_CUSTOMER_ID = "GLOBAL_CUSTOMER_ID"; + private static final String ORCH_STATUS = ""; public PresetAAIGetSubDetailsGet(String subscriberId) { this.subscriberId = subscriberId == null ? "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" : subscriberId; this.responseBody = baseResponseBody.replace(GLOBAL_CUSTOMER_ID, this.subscriberId); } - public void mapQueryParams(Map map) { - map.put("depth", Collections.singletonList("2")); + public PresetAAIGetSubDetailsGet(String subscriberId, String orchStatus) { + this.subscriberId = subscriberId == null ? "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" : subscriberId; + this.responseBody = baseResponseBody.replace(GLOBAL_CUSTOMER_ID, this.subscriberId); + this.responseBody = this.responseBody.replace("\"subscriber-name\":\"Emanuel\"", "\"subscriber-name\":\"SILVIA ROBBINS\""); + this.responseBody = this.responseBody.replaceAll(ORCH_STATUS, orchStatus); + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("depth", Collections.singletonList("2")); } @Override diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGetSpecificService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGetSpecificService.java new file mode 100644 index 000000000..615c196a9 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGetSpecificService.java @@ -0,0 +1,114 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import static vid.automation.test.infra.ModelInfo.serviceFabricSriovService; + +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; +import vid.automation.test.infra.ModelInfo; + +public class PresetAAIGetSubDetailsGetSpecificService extends BaseAAIPreset { + private String subscriberId; + private String subscriberName = "Emanuel"; + private String orchStatus; + + private String serviceInstanceId = "c187e9fe-40c3-4862-b73e-84ff056205f61234"; + private String serviceInstanceName = "test_fabric_config"; + private ModelInfo modelInfo = serviceFabricSriovService; + + public PresetAAIGetSubDetailsGetSpecificService(String subscriberId) { + this.subscriberId = subscriberId == null ? "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" : subscriberId; + } + + public PresetAAIGetSubDetailsGetSpecificService(String subscriberId, String subscriberName, String orchStatus, ModelInfo modelInfo, String serviceInstanceId) { + this(subscriberId); + this.subscriberName = subscriberName; + this.orchStatus = orchStatus; + this.modelInfo = modelInfo; + this.serviceInstanceId = serviceInstanceId; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("depth", Collections.singletonList("2")); + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/business/customers/customer/" + getSubscriberId(); + } + + public String getSubscriberId() { + return subscriberId; + } + + @Override + public Object getResponseBody() { + return "{" + + " \"global-customer-id\":\""+this.subscriberId+"\"," + + " \"subscriber-name\":\""+this.subscriberName+"\"," + + " \"subscriber-type\":\"INFRA\"," + + " \"resource-version\":\"1494255056308\"," + + " \"service-subscriptions\":{" + + " \"service-subscription\":[" + + " {" + + " \"service-type\":\"vFlowLogic\"," + + " \"resource-version\":\"1501700976809\"," + + " \"service-instances\":{" + + " \"service-instance\":[" + + " {" + + " \"service-instance-id\":\"414db2d4-18d0-415e-aac2-f255b586cfb5\"," + + " \"service-instance-name\":\"vFlowLogic-vflf_080117\"," + + " \"persona-model-id\":null," + + " \"persona-model-version\":null," + + " \"resource-version\":\"1502391806301\"," + + " \"orchestration-status\":\"Active\"," + + " \"model-invariant-id\":\"64dbe153-48c6-4d6f-95e7-12ff4cce9871\"," + + " \"model-version-id\":\"4e8b6372-dea3-4028-81d0-16eba59c94fb\"" + + " }," + + " {" + + " \"service-instance-id\":\"769be44e-981a-4da8-af3b-ca5fa76b7fb1\"," + + " \"service-instance-name\":\"vFlowLogic-vflp_080117\"," + + " \"persona-model-id\":null," + + " \"persona-model-version\":null," + + " \"resource-version\":\"1501712783617\"," + + " \"orchestration-status\":\"Active\"," + + " \"model-invariant-id\":\"14a99b56-dfb6-4300-97e1-ef10198ec936\"," + + " \"model-version-id\":\"9c6eee3b-8bd6-4a01-8afc-39441b63ecc9\"" + + " }" + + " ]" + + " }," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"TYLER SILVIA\"," + + " \"resource-version\":\"1501700976809\"," + + " \"service-instances\":{" + + " \"service-instance\":[" + + " {" + + " \"service-instance-id\": \""+this.serviceInstanceId+"\"," + + " \"service-instance-name\": \""+this.serviceInstanceName+"\"," + + " \"model-invariant-id\": \""+this.modelInfo.modelInvariantId+"\"," + + " \"model-version-id\": \""+this.modelInfo.modelVersionId+"\"," + + " \"resource-version\": \"1500789244674\"," + + " \"orchestration-status\": \""+this.orchStatus+"\"" + + " }" + + " ]" + + " }," + + " \"is-permitted\":false" + + " }" + + " ]" + + " }" + + "}"; + } + +} + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGet.java new file mode 100644 index 000000000..f6ce3e86d --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGet.java @@ -0,0 +1,153 @@ +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 class PresetAAIGetSubDetailsWithoutInstancesGet extends BaseAAIPreset { + private String subscriberId; + private String subscriberName = "Emanuel"; + + + public PresetAAIGetSubDetailsWithoutInstancesGet(String subscriberId) { + this.subscriberId = subscriberId == null ? "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" : subscriberId; + } + + public PresetAAIGetSubDetailsWithoutInstancesGet(String subscriberId, boolean isSubscriberUspVoice) { + this(subscriberId); + if (isSubscriberUspVoice) { + this.subscriberName = "SILVIA ROBBINS"; + } + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("depth", Collections.singletonList("1")); + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/business/customers/customer/" + getSubscriberId(); + } + + public String getSubscriberId() { + return subscriberId; + } + + @Override + public Object getResponseBody() { + return "{" + + " \"global-customer-id\":\"" + subscriberId + "\"," + + " \"subscriber-name\":\" " + subscriberName + "\"," + + " \"subscriber-type\":\"INFRA\"," + + " \"resource-version\":\"1494255056308\"," + + " \"service-subscriptions\":{" + + " \"service-subscription\":[" + + " {" + + " \"service-type\":\"vFlowLogic\"," + + " \"resource-version\":\"1501700976809\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"TYLER SILVIA\"," + + " \"resource-version\":\"1501700976809\"," + + " \"is-permitted\":true" + + " }," + + " {" + + " \"service-type\":\"Emanuel\"," + + " \"resource-version\":\"1505402148533\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"vBNG\"," + + " \"resource-version\":\"1498068165053\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"vVoiceMail\"," + + " \"resource-version\":\"1494254889686\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"Kennedy\"," + + " \"resource-version\":\"1509369877126\"," + + " \"is-permitted\":true" + + " }," + + " {" + + " \"service-type\":\"vSEGW\"," + + " \"resource-version\":\"1494254851983\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"vVM\"," + + " \"resource-version\":\"1494255049530\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"vOTA\"," + + " \"resource-version\":\"1501692006937\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"vMME\"," + + " \"resource-version\":\"1497729820723\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"vMNS\"," + + " \"resource-version\":\"1509391084129\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"vEsmeralda\"," + + " \"resource-version\":\"1501532104695\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"VPMS\"," + + " \"resource-version\":\"1509738154248\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"vWINIFRED\"," + + " \"resource-version\":\"1498752217386\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"SSD\"," + + " \"resource-version\":\"1494254866295\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"vMOG\"," + + " \"resource-version\":\"1500675745252\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"FIRSTNET\"," + + " \"resource-version\":\"1509387060781\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"ACTIVE_CHARGE\"," + + " \"resource-version\":\"1494255101364\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"vHSS\"," + + " \"resource-version\":\"1494254877333\"," + + " \"is-permitted\":false" + + " }" + + " ]" + + " }" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGetSpecificService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGetSpecificService.java new file mode 100644 index 000000000..62a587001 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsWithoutInstancesGetSpecificService.java @@ -0,0 +1,67 @@ +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 class PresetAAIGetSubDetailsWithoutInstancesGetSpecificService extends BaseAAIPreset { + private String subscriberId; + private String subscriberName = "Emanuel"; + + public PresetAAIGetSubDetailsWithoutInstancesGetSpecificService(String subscriberId) { + this.subscriberId = subscriberId == null ? "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" : subscriberId; + } + + public PresetAAIGetSubDetailsWithoutInstancesGetSpecificService(String subscriberId, String subscriberName) { + this(subscriberId); + this.subscriberName = subscriberName; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("depth", Collections.singletonList("1")); + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/business/customers/customer/" + getSubscriberId(); + } + + public String getSubscriberId() { + return subscriberId; + } + + @Override + public Object getResponseBody() { + return "{" + + " \"global-customer-id\":\""+this.subscriberId+"\"," + + " \"subscriber-name\":\""+this.subscriberName+"\"," + + " \"subscriber-type\":\"INFRA\"," + + " \"resource-version\":\"1494255056308\"," + + " \"service-subscriptions\":{" + + " \"service-subscription\":[" + + " {" + + " \"service-type\":\"vFlowLogic\"," + + " \"resource-version\":\"1501700976809\"," + + " \"is-permitted\":false" + + " }," + + " {" + + " \"service-type\":\"TYLER SILVIA\"," + + " \"resource-version\":\"1501700976809\"," + + " \"is-permitted\":false" + + " }" + + " ]" + + " }" + + "}"; + } + +} + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubscribersGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubscribersGet.java index b21e9de27..0517fd788 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubscribersGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetSubscribersGet.java @@ -3,14 +3,13 @@ package org.onap.simulator.presetGenerator.presets.aai; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; -import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; -import org.onap.simulator.presetGenerator.presets.model.Subscriber; -import org.springframework.http.HttpMethod; - import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Map; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.onap.simulator.presetGenerator.presets.model.Subscriber; +import org.springframework.http.HttpMethod; public class PresetAAIGetSubscribersGet extends BaseAAIPreset { @@ -29,26 +28,26 @@ public class PresetAAIGetSubscribersGet extends BaseAAIPreset { String subscribersString = "" + "[ " + " { " + - " \"global-customer-id\":\"MSO_1610_ST\", " + - " \"subscriber-name\":\"MSO_1610_ST\", " + + " \"global-customer-id\":\"CAR_2020_ER\", " + + " \"subscriber-name\":\"CAR_2020_ER\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1494001902987\" " + " }, " + " { " + " \"global-customer-id\":\"21014aa2-526b-11e6-beb8-9e71128cae77\", " + - " \"subscriber-name\":\"PACKET CORE\", " + + " \"subscriber-name\":\"JULIO ERICKSON\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1494001776295\" " + " }, " + " { " + " \"global-customer-id\":\"DHV1707-TestSubscriber-2\", " + - " \"subscriber-name\":\"ICORE CORE\", " + + " \"subscriber-name\":\"DALE BRIDGES\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1498751754450\" " + " }, " + " { " + " \"global-customer-id\":\"DHV1707-TestSubscriber-1\", " + - " \"subscriber-name\":\"PACKET1 CORE\", " + + " \"subscriber-name\":\"LLOYD BRIDGES\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1498595633607\" " + " }, " + @@ -65,59 +64,90 @@ public class PresetAAIGetSubscribersGet extends BaseAAIPreset { " \"resource-version\":\"1494001970225\" " + " }, " + " { " + - " \"global-customer-id\":\"DHV1802-TestSub-PWT-102\", " + - " \"subscriber-name\":\"DHV1802-TestSub-PWT-102\", " + + " \"global-customer-id\":\"ERICA5779-TestSub-PWT-102\", " + + " \"subscriber-name\":\"ERICA5779-TestSub-PWT-102\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1508852495058\" " + " }, " + " { " + - " \"global-customer-id\":\"DHV1802-TestSub-PWT-101\", " + - " \"subscriber-name\":\"DHV1802-TestSub-PWT-101\", " + + " \"global-customer-id\":\"ERICA5779-TestSub-PWT-101\", " + + " \"subscriber-name\":\"ERICA5779-TestSub-PWT-101\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1508179953733\" " + " }, " + " { " + " \"global-customer-id\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + - " \"subscriber-name\":\"Mobility\", " + + " \"subscriber-name\":\"Emanuel\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1494001894192\" " + " }, " + " { " + - " \"global-customer-id\":\"DHV1802-Subscriber-4\", " + - " \"subscriber-name\":\"DHV1802-Subscriber-5\", " + + " \"global-customer-id\":\"ERICA5779-Subscriber-4\", " + + " \"subscriber-name\":\"ERICA5779-Subscriber-5\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1509134064531\" " + " }, " + " { " + - " \"global-customer-id\":\"DHV1802-TestSub-PWT-103\", " + - " \"subscriber-name\":\"DHV1802-TestSub-PWT-103\", " + + " \"global-customer-id\":\"ERICA5779-TestSub-PWT-103\", " + + " \"subscriber-name\":\"ERICA5779-TestSub-PWT-103\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1509045503736\" " + " }, " + " { " + - " \"global-customer-id\":\"DHV1802-Subscriber-2\", " + - " \"subscriber-name\":\"DHV1802-Subscriber-2\", " + + " \"global-customer-id\":\"ERICA5779-Subscriber-2\", " + + " \"subscriber-name\":\"ERICA5779-Subscriber-2\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1509122065439\" " + " }, " + " { " + " \"global-customer-id\":\"e433710f-9217-458d-a79d-1c7aff376d89\", " + - " \"subscriber-name\":\"USP VOICE\", " + + " \"subscriber-name\":\"SILVIA ROBBINS\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1494001938080\" " + " }, " + " { " + - " \"global-customer-id\":\"DHV1802-Subscriber-3\", " + - " \"subscriber-name\":\"DHV1802-Subscriber-3\", " + + " \"global-customer-id\":\"ERICA5779-Subscriber-3\", " + + " \"subscriber-name\":\"ERICA5779-Subscriber-3\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1509122759407\" " + " }, " + " { " + " \"global-customer-id\":\"31739f3e-526b-11e6-beb8-9e71128cae77\", " + - " \"subscriber-name\":\"FIREWALL/MISC\", " + + " \"subscriber-name\":\"CRAIG/ROBERTS\", " + " \"subscriber-type\":\"INFRA\", " + " \"resource-version\":\"1494001772223\" " + - " } " + + " }, " + + " { " + + " \"global-customer-id\":\"global-customer-id\", " + + " \"subscriber-name\":\"global-customer-id\", " + + " \"subscriber-type\":\"INFRA\", " + + " \"resource-version\":\"1494001772226\", " + + " \"relationship-list\":{ " + + " \"relationship\":[ " + + " { " + + " \"related-to\":\"vpn-binding\", " + + " \"relationship-label\":\"org.onap.relationships.inventory.Uses\", " + + " \"related-link\":\"/aai/v14/network/vpn-bindings/vpn-binding/3e7834fb-a8e0-4243-a837-5352ccab4602\", " + + " \"relationship-data\":[ " + + " { " + + " \"relationship-key\":\"vpn-binding.vpn-id\", " + + " \"relationship-value\":\"3e7834fb-a8e0-4243-a837-5352ccab4602\" " + + " } " + + " ], " + + " \"related-to-property\":[ " + + " { " + + " \"property-key\":\"vpn-binding.vpn-name\", " + + " \"property-value\":\"LPPVPN\" " + + " }, " + + " { " + + " \"property-key\":\"vpn-binding.vpn-type\", " + + " \"property-value\":\"CUSTOMER\" " + + " } " + + " ] " + + " } " + + " ] " + + " } " + + " }" + " ] "; try { this.subscriberList = objectMapper.readValue(subscribersString, typeRef); diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetTenants.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetTenants.java index ed370cf15..638cc3911 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetTenants.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetTenants.java @@ -1,11 +1,28 @@ package org.onap.simulator.presetGenerator.presets.aai; +import static vid.automation.test.utils.ReadFile.loadResourceAsString; + import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; import org.springframework.http.HttpMethod; -import static vid.automation.test.utils.ReadFile.loadResourceAsString; - public class PresetAAIGetTenants extends BaseAAIPreset { + private final String subscriberId; + private final String serviceType; + private String responseBody; + + public PresetAAIGetTenants(String subscriberId, String serviceType, String responseBodyResource) { + this.subscriberId = subscriberId; + this.serviceType = serviceType; + this.responseBody = loadResourceAsString(responseBodyResource); + } + + public PresetAAIGetTenants() { + this( + "e433710f-9217-458d-a79d-1c7aff376d89", + "TYLER SILVIA", + "presets_templates/PresetAAIGetTenants.json" + ); + } @Override public Object getResponseBody() { @@ -19,9 +36,8 @@ public class PresetAAIGetTenants extends BaseAAIPreset { @Override public String getReqPath() { - return getRootPath() + "/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89/service-subscriptions/service-subscription/VIRTUAL USP"; + return getRootPath() + "/business/customers/customer/" + this.subscriberId + "/service-subscriptions/service-subscription/" + this.serviceType; } - private String responseBody = loadResourceAsString("presets_templates/PresetAAIGetTenants.json"); } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetVfModulesByVnf.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetVfModulesByVnf.java new file mode 100644 index 000000000..798a02642 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIGetVfModulesByVnf.java @@ -0,0 +1,83 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +public class PresetAAIGetVfModulesByVnf extends BaseAAIPreset { + private final String vnfInstanceId; + + public PresetAAIGetVfModulesByVnf(String vnfInstanceId) { + this.vnfInstanceId = vnfInstanceId; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/network/generic-vnfs/generic-vnf/" + this.vnfInstanceId + "/vf-modules"; + } + + @Override + public Object getResponseBody() { + return "" + + "{" + + " \"vf-module\": [{" + + " \"vf-module-id\": \"2c1ca484-cbc2-408b-ab86-25a2c15ce280\"," + + " \"vf-module-name\": \"ss820f_0918_db\"," + + " \"orchestration-status\": \"deleted\"," + + " \"is-base-vf-module\": false," + + " \"in-maint\": true," + + " \"automated-assignment\": false," + + " \"resource-version\": \"1537396469591\"," + + " \"model-invariant-id\": \"09edc9ef-85d0-4b26-80de-1f569d49e750\"," + + " \"model-version-id\": \"522159d5-d6e0-4c2a-aa44-5a542a12a830\"," + + " \"model-customization-id\": \"55b1be94-671a-403e-a26c-667e9c47d091\"," + + " \"module-index\": 0," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"vnfc\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v13/network/vnfcs/vnfc/ss820f_0918_refvnf_vnfinstancem002mmb001\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"vnfc.vnfc-name\"," + + " \"relationship-value\": \"ss820f_0918_refvnf_vnfinstancem002mmb001\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }, {" + + " \"vf-module-id\": \"3ef042c4-259f-45e0-9aba-0989bd8d1cc5\"," + + " \"vf-module-name\": \"ss820f_0918_base\"," + + " \"heat-stack-id\": \"\"," + + " \"orchestration-status\": \"Assigned\"," + + " \"is-base-vf-module\": true," + + " \"automated-assignment\": false," + + " \"resource-version\": \"1537310272044\"," + + " \"model-invariant-id\": \"1e463c9c-404d-4056-ba56-28fd102608de\"," + + " \"model-version-id\": \"dc229cd8-c132-4455-8517-5c1787c18b14\"," + + " \"model-customization-id\": \"8ad8670b-0541-4499-8101-275bbd0e8b6a\"," + + " \"module-index\": 0," + + " \"relationship-list\": {" + + " \"relationship\": [{" + + " \"related-to\": \"vnfc\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": \"/aai/v13/network/vnfcs/vnfc/ss820f_0918_refvnf_vnfinstancem001mmb001\"," + + " \"relationship-data\": [{" + + " \"relationship-key\": \"vnfc.vnfc-name\"," + + " \"relationship-value\": \"ss820f_0918_refvnf_vnfinstancem001mmb001\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + "}"; + } + + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGet.java new file mode 100644 index 000000000..429d17647 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIModelsByInvariantIdGet.java @@ -0,0 +1,394 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +import java.util.List; +import java.util.Map; + +import static java.util.stream.Collectors.joining; + +public class PresetAAIModelsByInvariantIdGet extends BaseAAIPreset { + private final ImmutableList modelInvariantIds; + + public PresetAAIModelsByInvariantIdGet(ImmutableList modelInvariantIds) { + this.modelInvariantIds = modelInvariantIds; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/service-design-and-creation/models"; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.builder() + .put("depth", ImmutableList.of("2")) + .put("model-invariant-id", modelInvariantIds) + .build(); + } + + @Override + public Object getResponseBody() { + // based on aai_get_model_by_2_invariant_ids.json + // should be refined to match input + return "" + + "{" + + " \"model\": [" + + modelInvariantIds.stream().map(modelInvariantId -> + " {" + + " \"model-invariant-id\": \""+modelInvariantId+"\"," + + " \"model-type\": \"resource\"," + + " \"resource-version\": \"1507472057666\"," + + " \"model-vers\": {" + + " \"model-ver\": [" + + " {" + + " \"model-version-id\": \"7a6ee536-f052-46fa-aa7e-2fca9d674c44\"," + + " \"model-name\": \"vf_vEPDG\"," + + " \"model-version\": \"2.0\"," + + " \"model-description\": \"vEPDG\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_ERROR\"," + + " \"resource-version\": \"1507649620979\"," + + " \"model-elements\": {" + + " \"model-element\": [" + + " {" + + " \"model-element-uuid\": \"ccbc6dc9-58ad-4082-a81f-630114d99a70\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1507649620982\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"model-ver\"," + + " \"related-link\": \"/aai/v11/service-design-and-creation/models/model/acc6edd8-a8d4-4b93-afaa-0994068be14c/model-vers/model-ver/93a6166f-b3d5-4f06-b4ba-aed48d009ad9\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"acc6edd8-a8d4-4b93-afaa-0994068be14c\"" + + " }," + + " {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"93a6166f-b3d5-4f06-b4ba-aed48d009ad9\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"generic-vnf\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"model-element\"," + + " \"related-link\": \"/aai/v11/service-design-and-creation/models/model/d661b5fd-e0be-457e-a5ca-e345621af761/model-vers/model-ver/6019af4d-1902-47b1-a7ee-4609c198bf37/model-elements/model-element/8cf71918-6cce-4e01-8049-3f980f8f2b00/model-elements/model-element/4703eeb3-7200-4546-aff2-6e942ac0c0e1\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"d661b5fd-e0be-457e-a5ca-e345621af761\"" + + " }," + + " {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"6019af4d-1902-47b1-a7ee-4609c198bf37\"" + + " }," + + " {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"8cf71918-6cce-4e01-8049-3f980f8f2b00\"" + + " }," + + " {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"4703eeb3-7200-4546-aff2-6e942ac0c0e1\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"model-version-id\": \"eb5f56bf-5855-4e61-bd00-3e19a953bf02\"," + + " \"model-name\": \"vf_vEPDG\"," + + " \"model-version\": \"1.0\"," + + " \"model-description\": \"vEPDG\"," + + " \"resource-version\": \"1507472057702\"," + + " \"model-elements\": {" + + " \"model-element\": [" + + " {" + + " \"model-element-uuid\": \"18881687-8dab-4ec8-ab65-ebf8f95a6599\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1507472057707\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"model-ver\"," + + " \"related-link\": \"/aai/v11/service-design-and-creation/models/model/acc6edd8-a8d4-4b93-afaa-0994068be14c/model-vers/model-ver/93a6166f-b3d5-4f06-b4ba-aed48d009ad9\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"acc6edd8-a8d4-4b93-afaa-0994068be14c\"" + + " }," + + " {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"93a6166f-b3d5-4f06-b4ba-aed48d009ad9\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"generic-vnf\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"model-element\"," + + " \"related-link\": \"/aai/v11/service-design-and-creation/models/model/d661b5fd-e0be-457e-a5ca-e345621af761/model-vers/model-ver/de6f879b-37a9-44a5-97ed-cd52cc14bc47/model-elements/model-element/7a074be4-fcf1-46a5-88ee-41a7c7a6faab/model-elements/model-element/72f0adb5-5294-46f7-8085-a8aee9cb5f49\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"d661b5fd-e0be-457e-a5ca-e345621af761\"" + + " }," + + " {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"de6f879b-37a9-44a5-97ed-cd52cc14bc47\"" + + " }," + + " {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"7a074be4-fcf1-46a5-88ee-41a7c7a6faab\"" + + " }," + + " {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"72f0adb5-5294-46f7-8085-a8aee9cb5f49\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"model-version-id\": \"b7f2e8fb-ac71-4ea0-a801-06ef1479ea84\"," + + " \"model-name\": \"vf_vEPDG\"," + + " \"model-version\": \"4.0\"," + + " \"model-description\": \"vEPDG_Up\"," + + " \"resource-version\": \"1508954433176\"," + + " \"model-elements\": {" + + " \"model-element\": [" + + " {" + + " \"model-element-uuid\": \"4ed7025a-d37b-444f-8008-5c7c41d76d47\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1508954433179\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"model-ver\"," + + " \"related-link\": \"/aai/v11/service-design-and-creation/models/model/acc6edd8-a8d4-4b93-afaa-0994068be14c/model-vers/model-ver/93a6166f-b3d5-4f06-b4ba-aed48d009ad9\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"acc6edd8-a8d4-4b93-afaa-0994068be14c\"" + + " }," + + " {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"93a6166f-b3d5-4f06-b4ba-aed48d009ad9\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"generic-vnf\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"model-element\"," + + " \"related-link\": \"/aai/v11/service-design-and-creation/models/model/d661b5fd-e0be-457e-a5ca-e345621af761/model-vers/model-ver/0e3f3390-48dd-4640-aed7-0eb873d40a97/model-elements/model-element/106d11a5-2b8c-4586-a56d-ee387e822757/model-elements/model-element/3d7e724a-6f05-4111-8b22-78d024c53081\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"d661b5fd-e0be-457e-a5ca-e345621af761\"" + + " }," + + " {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"0e3f3390-48dd-4640-aed7-0eb873d40a97\"" + + " }," + + " {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"106d11a5-2b8c-4586-a56d-ee387e822757\"" + + " }," + + " {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"3d7e724a-6f05-4111-8b22-78d024c53081\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"model-version-id\": \"4117a0b6-e234-467d-b5b9-fe2f68c8b0fc\"," + + " \"model-name\": \"Grouping Service for Test\"," + + " \"model-version\": \"1.0\"," + + " \"model-description\": \"vEPDG_Up\"," + + " \"resource-version\": \"1508954433176\"," + + " \"model-elements\": {" + + " \"model-element\": [" + + " {" + + " \"model-element-uuid\": \"4ed7025a-d37b-444f-8008-5c7c41d76d47\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1508954433179\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"model-ver\"," + + " \"related-link\": \"/aai/v11/service-design-and-creation/models/model/acc6edd8-a8d4-4b93-afaa-0994068be14c/model-vers/model-ver/93a6166f-b3d5-4f06-b4ba-aed48d009ad9\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"acc6edd8-a8d4-4b93-afaa-0994068be14c\"" + + " }," + + " {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"93a6166f-b3d5-4f06-b4ba-aed48d009ad9\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"generic-vnf\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"model-element\"," + + " \"related-link\": \"/aai/v11/service-design-and-creation/models/model/d661b5fd-e0be-457e-a5ca-e345621af761/model-vers/model-ver/0e3f3390-48dd-4640-aed7-0eb873d40a97/model-elements/model-element/106d11a5-2b8c-4586-a56d-ee387e822757/model-elements/model-element/3d7e724a-6f05-4111-8b22-78d024c53081\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"d661b5fd-e0be-457e-a5ca-e345621af761\"" + + " }," + + " {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"0e3f3390-48dd-4640-aed7-0eb873d40a97\"" + + " }," + + " {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"106d11a5-2b8c-4586-a56d-ee387e822757\"" + + " }," + + " {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"3d7e724a-6f05-4111-8b22-78d024c53081\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }," + + " {" + + " \"model-version-id\": \"6e59c5de-f052-46fa-aa7e-2fca9d674c44\"," + + " \"model-name\": \"vf_vEPDG\"," + + " \"model-version\": \"5.0\"," + + " \"model-description\": \"vEPDG_Up\"," + + " \"resource-version\": \"1509570916147\"," + + " \"model-elements\": {" + + " \"model-element\": [" + + " {" + + " \"model-element-uuid\": \"49899999-076d-456b-915c-078d1b2a05b3\"," + + " \"new-data-del-flag\": \"T\"," + + " \"cardinality\": \"unbounded\"," + + " \"resource-version\": \"1509570916150\"," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"model-ver\"," + + " \"related-link\": \"/aai/v11/service-design-and-creation/models/model/acc6edd8-a8d4-4b93-afaa-0994068be14c/model-vers/model-ver/93a6166f-b3d5-4f06-b4ba-aed48d009ad9\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"acc6edd8-a8d4-4b93-afaa-0994068be14c\"" + + " }," + + " {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"93a6166f-b3d5-4f06-b4ba-aed48d009ad9\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"model-ver.model-name\"," + + " \"property-value\": \"generic-vnf\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }," + + " \"relationship-list\": {" + + " \"relationship\": [" + + " {" + + " \"related-to\": \"model-element\"," + + " \"related-link\": \"/aai/v11/service-design-and-creation/models/model/d661b5fd-e0be-457e-a5ca-e345621af761/model-vers/model-ver/03655348-0148-4482-b0b7-a5de71ab6264/model-elements/model-element/e97f008f-fc19-4b6e-8842-e54ec6eafb6e/model-elements/model-element/cfc574f2-6869-41d3-bfae-42b54b711568\"," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"model.model-invariant-id\"," + + " \"relationship-value\": \"d661b5fd-e0be-457e-a5ca-e345621af761\"" + + " }," + + " {" + + " \"relationship-key\": \"model-ver.model-version-id\"," + + " \"relationship-value\": \"03655348-0148-4482-b0b7-a5de71ab6264\"" + + " }," + + " {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"e97f008f-fc19-4b6e-8842-e54ec6eafb6e\"" + + " }," + + " {" + + " \"relationship-key\": \"model-element.model-element-uuid\"," + + " \"relationship-value\": \"cfc574f2-6869-41d3-bfae-42b54b711568\"" + + " }" + + " ]" + + " }" + + " ]" + + " }" + + " }" + + " ]" + + " }" + + " }").collect(joining(", ")) + + " ]" + + " }"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIPostNamedQueryForViewEdit.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIPostNamedQueryForViewEdit.java index e098a576d..0d143b50c 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIPostNamedQueryForViewEdit.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIPostNamedQueryForViewEdit.java @@ -6,15 +6,20 @@ import org.springframework.http.HttpMethod; public class PresetAAIPostNamedQueryForViewEdit extends BaseAAIPreset { private final String serviceInstanceId; - private final boolean hasConfigurationInstance; + private final boolean hasProxyConfigurationInstance; + private final boolean hasFabricConfigurationInstance; + private String serviceInstanceName; + public static final String DEFAULT_SERVICE_INSTANCE_NAME = "test_sssdad"; - public PresetAAIPostNamedQueryForViewEdit(String serviceInstanceId) { - this(serviceInstanceId, true); + public PresetAAIPostNamedQueryForViewEdit(String serviceInstanceId, boolean hasProxyConfigurationInstance, boolean hasFabricConfigurationInstance) { + this(serviceInstanceId, DEFAULT_SERVICE_INSTANCE_NAME, hasProxyConfigurationInstance, hasFabricConfigurationInstance); } - public PresetAAIPostNamedQueryForViewEdit(String serviceInstanceId, boolean hasConfigurationInstance) { + public PresetAAIPostNamedQueryForViewEdit(String serviceInstanceId, String serviceInstanceName, boolean hasProxyConfigurationInstance, boolean hasFabricConfigurationInstance) { this.serviceInstanceId = serviceInstanceId; - this.hasConfigurationInstance = hasConfigurationInstance; + this.serviceInstanceName = serviceInstanceName; + this.hasProxyConfigurationInstance = hasProxyConfigurationInstance; + this.hasFabricConfigurationInstance = hasFabricConfigurationInstance; } // inspired by @@ -44,7 +49,7 @@ public class PresetAAIPostNamedQueryForViewEdit extends BaseAAIPreset { " \"service-instance-id\": \"" + serviceInstanceId + "\"" + " }," + " \"service-subscription\": {" + - " \"service-type\": \"VIRTUAL USP\"" + + " \"service-type\": \"TYLER SILVIA\"" + " }" + " }" + " ]" + @@ -65,10 +70,10 @@ public class PresetAAIPostNamedQueryForViewEdit extends BaseAAIPreset { " \"model-name\": \"0eOHz2Yh8WJcBYzKy079\"," + " \"service-instance\": {" + " \"service-instance-id\": \"" + serviceInstanceId + "\"," + - " \"service-instance-name\": \"test_sssdad\"" + + " \"service-instance-name\": \"" + serviceInstanceName + "\"" + " }," + " \"extra-properties\": {}"; - if(hasConfigurationInstance) { + if(hasProxyConfigurationInstance) { response += "," + " \"inventory-response-items\": {" + " \"inventory-response-item\": [{" + @@ -92,6 +97,29 @@ public class PresetAAIPostNamedQueryForViewEdit extends BaseAAIPreset { " ]" + " }"; } + else if(hasFabricConfigurationInstance) { + response += "," + + " \"inventory-response-items\": {" + + " \"inventory-response-item\": [{" + + " \"model-name\": \"Fabric-Configuration-Instance\"," + + " \"configuration\": {" + + " \"configuration-id\": \"1234-fabric-config-LB1113\"," + + " \"configuration-name\": \"dummy_instance\"," + + " \"configuration-type\": \"fabric-configuration-type-1234\"," + + " \"configuration-sub-type\": \"fabric-configuration-sub-type-1234\"," + + " \"model-invariant-id\": \"model-invariant-id-1234\"," + + " \"model-version-id\": \"model-version-id-1234\"," + + " \"orchestration-status\": \"Assigned\"," + + " \"operational-status\": \"\"," + + " \"configuration-selflink\": \"\"," + + " \"model-customization-id\": \"model-customization-id-1234\"," + + " \"resource-version\": \"1504038855716\"" + + " }," + + " \"extra-properties\": {}" + + " }" + + " ]" + + " }"; + } response += " }" + " ]" + "}"; diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryEmptyResult.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryEmptyResult.java deleted file mode 100644 index f5ab2d1f7..000000000 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryEmptyResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.onap.simulator.presetGenerator.presets.aai; - -public class PresetAAISearchNodeQueryEmptyResult extends PresetAAIBaseSearchNodeQuery { - - @Override - public Object getResponseBody() { - return "{}"; - } - - @Override - public int getResponseCode() { - return 200; - } -} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java new file mode 100644 index 000000000..29e7d5092 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java @@ -0,0 +1,46 @@ +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; + +public class PresetAAISearchNodeQueryNonEmptyResult extends PresetAAIBaseSearchNodeQuery { + + private final String type; + private final String name; + + public PresetAAISearchNodeQueryNonEmptyResult(String type, String name) { + this.type = type; + this.name = name; + } + + @Override + public Object getResponseBody() { + return "{ \"something\": [] }"; + } + + @Override + public int getResponseCode() { + return 200; + } + + @Override + public String getReqPath() { + return getRootPath() + "/nodes/" + searchPath(); + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of(searchKey(), Collections.singletonList(name)); + } + + private String searchPath() { + return type + "s"; + } + + private String searchKey() { + return type + "-name"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIServiceDesignAndCreationPut.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIServiceDesignAndCreationPut.java index 6a97e1159..180685282 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIServiceDesignAndCreationPut.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIServiceDesignAndCreationPut.java @@ -4,40 +4,34 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; import org.springframework.http.HttpMethod; +import vid.automation.test.infra.ModelInfo; +import vid.automation.test.test.BrowseASDCTest; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import static vid.automation.test.infra.ModelInfo.ModelInfoWithMultipleVersions.modelInfoWithMultipleVersions; + public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset { public PresetAAIServiceDesignAndCreationPut(boolean emptyList) { - serviceModelIdentifiers = ImmutableList.of(); + modelInfos = ImmutableList.of(); this.emptyList = emptyList; } - public PresetAAIServiceDesignAndCreationPut(String modelVersionId, String modelInvariantId) { - serviceModelIdentifiers = ImmutableList.of(new ServiceModelIdentifiers(modelVersionId, modelInvariantId)); - } - public PresetAAIServiceDesignAndCreationPut(List serviceModelIdentifiers) { - this.serviceModelIdentifiers = serviceModelIdentifiers; - } + private List modelInfos; + boolean emptyList; - public static class ServiceModelIdentifiers { - public final String modelVersionId; - public final String modelInvariantId; - public ServiceModelIdentifiers(String modelVersionId, String modelInvariantId) { - this.modelVersionId = modelVersionId; - this.modelInvariantId = modelInvariantId; - } + //Constructor that use the super set of model infos as response + //all test should be migrated to use this constructor + public PresetAAIServiceDesignAndCreationPut() { + this.modelInfos = ModelInfo.superSetOfModelInfos; } - private List serviceModelIdentifiers; - boolean emptyList; - @Override public HttpMethod getReqMethod() { return HttpMethod.PUT; @@ -62,16 +56,16 @@ public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset { private String presetModels() { return - serviceModelIdentifiers.stream().map(identifiers -> + modelInfos.stream().map(modelInfo -> " {" + " \"model\": {" + - " \"model-invariant-id\": \"" + identifiers.modelInvariantId + "\"," + + " \"model-invariant-id\": \"" + modelInfo.modelInvariantId + "\"," + " \"model-type\": \"resource\"," + " \"resource-version\": \"1500138206526\"," + " \"model-vers\": {" + " \"model-ver\": [" + " {" + - " \"model-version-id\": \"" + identifiers.modelVersionId + "\"," + + " \"model-version-id\": \"" + modelInfo.modelVersionId + "\"," + " \"model-name\": \"action-data\"," + " \"model-version\": \"1.0\"," + " \"model-description\": \"lustre settler sideways volcanic eight cellular\"," + @@ -112,6 +106,89 @@ public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset { } + private String serviceWithMultipleVersions() { + return + " {" + + " \"model\": {" + + " \"model-invariant-id\": \"" + modelInfoWithMultipleVersions.modelInvariantId + "\"," + + " \"model-type\": \"resource\"," + + " \"resource-version\": \"1500138206526\"," + + " \"model-vers\": {" + + " \"model-ver\": [" + + " {" + + " \"model-version-id\": \"" + modelInfoWithMultipleVersions.modelVersionId1 + "\"," + + " \"model-name\": \""+modelInfoWithMultipleVersions.modelName+"\"," + + " \"model-version\": \"1.0\"," + + " \"model-description\": \"decontamination arm circus ammonia hump edge\"," + + " \"resource-version\": \"1500137463984\"" + + " }," + + " {" + + " \"model-version-id\": \"" + modelInfoWithMultipleVersions.modelVersionId3 + "\"," + + " \"model-name\": \""+modelInfoWithMultipleVersions.modelName+"\"," + + " \"model-version\": \"3.0\"," + + " \"model-description\": \"Non decontamination arm circus ammonia hump edge\"," + + " \"resource-version\": \"1500137463986\"" + + " }," + + " {" + + " \"model-version-id\": \"" + modelInfoWithMultipleVersions.modelVersionId2 + "\"," + + " \"model-name\": \""+modelInfoWithMultipleVersions.modelName+"\"," + + " \"model-version\": \"2.0\"," + + " \"model-description\": \"The oldest one\"," + + " \"resource-version\": \"1500137463980\"" + + " }" + + " ]" + + " }" + + " }" + + " }," ; + } + + public String modelsForBrowseSDCServiceModelListCheckAAIResponse() { + return " {\"model\": { " + + " \"model-invariant-id\": \"" + BrowseASDCTest.modelInvariantUUID1 + "\"," + + " \"model-type\": \"service\"," + + " \"resource-version\": \"1515103312329\"," + + " \"model-vers\": {\"model-ver\": [" + + " {" + + " \"model-version-id\": \"" + BrowseASDCTest.modelUuid + "\"," + + " \"model-name\": \"CheckAAIResponse_AAAvIRC_mm779p_Service\"," + + " \"model-version\": \"1.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_OK\"," + + " \"model-description\": \"tbd\"," + + " \"resource-version\": \"1516206395612\"" + + " }" + + " ]}" + + " }}," + + " {\"model\": { " + + " \"model-invariant-id\": \"" + BrowseASDCTest.modelInvariantUUID2 + "\"," + + " \"model-type\": \"service\"," + + " \"resource-version\": \"1515103312329\"," + + " \"model-vers\": {\"model-ver\": [" + + " {" + + " \"model-version-id\": \"1dae721c-a1ef-435f-b811-760c23f467bf\"," + + " \"model-name\": \"CheckAAIResponse_BBBvIRC_mm779p_Service\"," + + " \"model-version\": \"3.0\"," + + " \"model-description\": \"tbd\"," + + " \"resource-version\": \"1516025197086\"" + + " }" + + " ]}" + + " }}," + + " {\"model\": { " + + " \"model-invariant-id\": \"" + BrowseASDCTest.modelInvariantUUID3 + "\"," + + " \"model-type\": \"service\"," + + " \"resource-version\": \"1515103312329\"," + + " \"model-vers\": {\"model-ver\": [" + + " {" + + " \"model-version-id\": \"29236d45-e790-4c17-a115-1533cc09b7b1\"," + + " \"model-name\": \"CheckAAIResponse_CCCvIRC_mm779p_Service\"," + + " \"model-version\": \"4.0\"," + + " \"distribution-status\": \"DISTRIBUTION_COMPLETE_ERROR\"," + + " \"model-description\": \"tbd\"," + + " \"resource-version\": \"1517319724440\"" + + " }" + + " ]}" + + " }},"; + } + @Override public Object getResponseBody() { if(emptyList) { @@ -119,6 +196,8 @@ public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset { } return "{\"results\": [" + presetModels()+ + serviceWithMultipleVersions() + + modelsForBrowseSDCServiceModelListCheckAAIResponse() + " {" + " \"model\": {" + " \"model-invariant-id\": \"00beb8f9-6d39-452f-816d-c709b9cbb87d\"," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java new file mode 100644 index 000000000..13ee91e2b --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java @@ -0,0 +1,239 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; +import static org.apache.commons.text.StringEscapeUtils.escapeJson; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultimap; +import com.google.common.collect.Multimap; +import java.util.UUID; +import java.util.stream.Collectors; +import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.text.StrSubstitutor; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +public class PresetAAIStandardQueryGet extends BaseAAIPreset { + private final String instanceId; + private final String instanceName; + private final String instanceType; + private final String instanceRole; + private final String additionalProperties; + private final String uri; + private final String typeInResponse; + private final Multimap relationshipsUris; + + private PresetAAIStandardQueryGet(String typeInResponse, String instanceId, String instanceName, String instanceType, String instanceRole, String uri, Multimap relationshipsUris, String additionalProperties) { + this.instanceId = defaultIfNull(instanceId, randomUUID()); + this.instanceName = defaultIfNull(instanceName, randomAlphanumeric()); + this.instanceType = defaultIfNull(instanceType, randomAlphanumeric()); + this.instanceRole = defaultIfNull(instanceRole, randomAlphanumeric()); + this.uri = uri; + this.typeInResponse = typeInResponse; + this.additionalProperties = additionalProperties; + this.relationshipsUris = relationshipsUris; + } + + private PresetAAIStandardQueryGet(String typeInResponse, String instanceId, String uri, Multimap relationshipsUris, String additionalProperties) { + this(typeInResponse, instanceId, randomAlphanumeric(), randomAlphanumeric(), randomAlphanumeric(), uri, relationshipsUris, additionalProperties); + } + + public static PresetAAIStandardQueryGet ofServiceInstance(String instanceId, final String modelVersionId, final String modelInvariantId, String subscriberId, String serviceType, Multimap relationshipsUris) { + return new PresetAAIStandardQueryGet( + "service-instance", instanceId, + new StrSubstitutor(ImmutableMap.of( + "global-customer-id", subscriberId, + "service-type", serviceType, + "service-instance-id", instanceId + )).replace("" + + "/business/customers/customer/${global-customer-id}" + + "/service-subscriptions/service-subscription/${service-type}" + + "/service-instances/service-instance/${service-instance-id}"), + relationshipsUris, "" + + "\"model-invariant-id\": \"" + modelInvariantId + "\", " + + "\"model-version-id\": \"" + modelVersionId + "\", " + + "\"resource-version\": \"GARBAGE DATA\", " + + "\"orchestration-status\": \"GARBAGE DATA\", " + ); + } + + public static PresetAAIStandardQueryGet ofInstanceGroup(String groupType, String groupRole, Multimap relationshipsUris) { + final String instanceId = randomUUID(); + return new PresetAAIStandardQueryGet( + "instance-group", instanceId, randomAlphanumeric(), groupType, groupRole, + "/network/instance-groups/instance-group/" + instanceId, + relationshipsUris, "" + + " \"id\": \"" + instanceId + "\"," + + " \"model-invariant-id\": \"4bb2e27e-ddab-4790-9c6d-1f731bc14a45\"," + + " \"model-version-id\": \"daeb6568-cef8-417f-9075-ed259ce59f48\"," + + " \"description\": \"vTSBC Customer Landing Network Collection Desc\"," + + " \"resource-version\": \"1536169790853\"," + + " \"instance-group-function\": \"vTSBC Customer Landing Network Collection\"," + ); + } + + public static PresetAAIStandardQueryGet ofVnf(String instanceId, Multimap relationshipsUris) { + return ofVnf(instanceId, "vnf-instance-model-version-id", "vnf-instance-model-customization-id", "", relationshipsUris); + } + + public static PresetAAIStandardQueryGet ofVnf(String instanceId, String modelVersionId,String modelCustomizationId, String additionalProperties, Multimap relationshipsUris) { + return new PresetAAIStandardQueryGet( + "vnf", instanceId, + "/network/generic-vnfs/generic-vnf/" + instanceId, + relationshipsUris, additionalProperties + + "\"model-invariant-id\": \"vnf-instance-model-invariant-id\", " + + "\"model-customization-id\": \"" + modelCustomizationId + "\", "+ + "\"model-version-id\": \"" + modelVersionId + "\", " + ); + } + + public static PresetAAIStandardQueryGet ofRelatedVnf(String instanceId, String modelVersionId, String additionalProperties, Multimap relationshipsUris) { + return new PresetAAIStandardQueryGet( + "vnf", instanceId, + "/network/generic-vnfs/generic-vnf/" + instanceId, + relationshipsUris, additionalProperties + + "\"model-invariant-id\": \"vnf-instance-model-invariant-id\", " + + "\"model-version-id\": \"" + modelVersionId + "\", " + ); + } + + private static String randomAlphanumeric() { + return RandomStringUtils.randomAlphanumeric(17); + } + + private static String randomUUID() { + return UUID.randomUUID().toString(); + } + + public static PresetAAIStandardQueryGet ofL3Network(String instanceType, String orchStatus, Multimap relationshipsUris) { + return ofL3Network(randomUUID(), randomAlphanumeric(), instanceType, relationshipsUris, orchStatus, "prov", "network-instance-model-version-id", "network-instance-model-customization-id"); + } + + public static PresetAAIStandardQueryGet ofL3Network(String instanceType, String orchStatus, String provStatus, String modelVersionId, String modelCustomizationId,Multimap relationshipsUris) { + return ofL3Network(randomUUID(), randomAlphanumeric(), instanceType, relationshipsUris, orchStatus, provStatus, modelVersionId, modelCustomizationId); + } + + public static PresetAAIStandardQueryGet ofL3Network(String instanceId, String instanceName, String instanceType, Multimap relationshipsUris, String orchStatus) { + return ofL3Network(instanceId, instanceName, instanceType, relationshipsUris, orchStatus, "prov", "network-instance-model-version-id", "94fdd893-4a36-4d70-b16a-ec29c54c184f"); + } + + public static PresetAAIStandardQueryGet ofL3Network(String instanceId, String instanceName, String instanceType, Multimap relationshipsUris, String orchStatus, String provStatus, String modelVersionId, String modelCustomizationId) { + return new PresetAAIStandardQueryGet( + "network", instanceId, instanceName, instanceType, randomAlphanumeric(), + "/network/l3-networks/l3-network/" + instanceId, + relationshipsUris, "" + + "\"orchestration-status\": \"" + orchStatus + "\"," + + "\"prov-status\": \"" + provStatus + "\"," + + "\"network-technology\": \"contrail\", " + + "\"neutron-network-id\": \"66ee6123-1c45-4e71-b6c0-a748ae0fee88\", " + + "\"is-bound-to-vpn\": true, " + + "\"is-external-network\": true, " + + "\"model-invariant-id\": \"network-instance-model-invariant-id\", " + + "\"model-customization-id\": \"" + modelCustomizationId + "\", " + + "\"model-version-id\": \"" + modelVersionId + "\", " + ); + } + + public static PresetAAIStandardQueryGet ofVolumeGroup(String instanceType, Multimap relationshipsUris) { + final String instanceId = randomUUID(); + return new PresetAAIStandardQueryGet( + "volume-group", instanceId, randomAlphanumeric(), instanceType, randomAlphanumeric(), + "/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson5b/volume-groups/volume-group/" + instanceId, + relationshipsUris, "" + + " \"vnf-type\": \"vSON_test_ap7145/vSON_test_ap7145 0\"," + + " \"orchestration-status\": \"Active\"," + + " \"model-customization-id\": \"bc3bbdcc-42f3-4682-b151-99c308d15255\"," + + " \"vf-module-model-customization-id\": \"bc3bbdcc-42f3-4682-b151-99c308d15255\"," + + " \"resource-version\": \"1533679899735\"," + ); + } + + public static PresetAAIStandardQueryGet ofCollectionResource(String orchStatus, Multimap relationshipsUris) { + final String instanceId = randomUUID(); + return new PresetAAIStandardQueryGet( + "collection", instanceId, randomAlphanumeric(), "L3-NETWORK", randomAlphanumeric(), + "/network/collections/collection/" + instanceId, + relationshipsUris, "" + + "\"orchestration-status\": \"" + orchStatus + "\", " + + "\"model-invariant-id\": \"081ceb56-eb71-4566-a72d-3e7cbee5cdf1\", " + + "\"model-version-id\": \"ce8c98bc-4691-44fb-8ff0-7a47487c11c4\", " + ); + } + + public static PresetAAIStandardQueryGet ofVlanTag(int vlanIdOuter) { + final String instanceId = randomUUID(); + return new PresetAAIStandardQueryGet( + "vlan-tag", instanceId, + "/this is an invented link/tag/vlan-tags/vlan-tag/" + instanceId, + ImmutableMultimap.of(), "" + + "\"vlan-interface\": \"US-10688-genvnf-vlan-interface1\", " + + "\"vlan-id-inner\": " + 123456789 + ", " + + "\"vlan-id-outer\": " + vlanIdOuter + ", " + + "\"resource-version\": \"1518934744675\", " + + "\"in-maint\": false, " + + "\"is-ip-unnumbered\": false, " + ); + } + + public String getInstanceId() { + return instanceId; + } + + public String getInstanceName() { + return instanceName; + } + + public String getInstanceType() { + return instanceType; + } + + public String getInstanceRole() { + return instanceRole; + } + + @Override + public Object getResponseBody() { + return "" + + "{ " + + " \"" + typeInResponse + "-id\": \"" + getInstanceId() + "\", " + + " \"" + typeInResponse + "-name\": \"" + escapeJson(getInstanceName()) + "\", " + + " \"" + typeInResponse + "-type\": \"" + escapeJson(getInstanceType()) + "\", " + + " \"" + typeInResponse + "-role\": \"" + escapeJson(getInstanceRole()) + "\", " + + additionalProperties + + " \"relationship-list\": { " + + " \"relationship\": [ " + + relationshipsUris.entries().stream().map( + entry -> buildRelationship(entry.getKey(), entry.getValue()) + ).collect(Collectors.joining(",")) + + " ] " + + " } " + + "} "; + } + + private String buildRelationship(String relatedTo, final String relatedLink) { + return "" + + "{ " + + " \"related-to\": \"" + relatedTo + "\", " + + " \"relationship-label\": \"org.onap.relationships.inventory.ComposedOf\", " + + " \"related-link\": \"" + relatedLink + "\", " + + " \"relationship-data\": [" + + " { " + + " \"relationship-key\": \"GARBAGE DATA\", " + + " \"relationship-value\": \"GARBAGE DATA\" " + + " } " + + " ] " + + "}"; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + uri; + } + + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/ecompportal_att/PresetGetSessionSlotCheckIntervalGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/ecompportal_att/PresetGetSessionSlotCheckIntervalGet.java index 55cc3dbc6..02ff1c159 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/ecompportal_att/PresetGetSessionSlotCheckIntervalGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/ecompportal_att/PresetGetSessionSlotCheckIntervalGet.java @@ -13,6 +13,6 @@ public class PresetGetSessionSlotCheckIntervalGet extends BaseEcompPortalPreset } public String getReqPath() { - return getRootPath() + "//getSessionSlotCheckInterval"; + return getRootPath() + "/v3/getSessionSlotCheckInterval"; } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/model/RegistrationRequest.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/model/RegistrationRequest.java index 680dabe92..56fd1c9a7 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/model/RegistrationRequest.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/model/RegistrationRequest.java @@ -11,6 +11,8 @@ public class RegistrationRequest { public static class SimulatorRequest { public final HttpMethod method; public final String path; + public final boolean strict; + public final Map headers; @JsonInclude(JsonInclude.Include.NON_NULL) public final Map queryParams; @@ -18,11 +20,13 @@ public class RegistrationRequest { @JsonInclude(JsonInclude.Include.NON_NULL) public final Object body; - public SimulatorRequest(HttpMethod method, String path, Map queryParams, Object body) { + public SimulatorRequest(HttpMethod method, String path, Map queryParams, Object body, boolean strictMatch, Map headers) { this.method = method; this.path = path; this.queryParams = queryParams; this.body = body; + this.strict = strictMatch; + this.headers = headers; } } @@ -44,11 +48,27 @@ public class RegistrationRequest { } } + public static class Misc { + + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer numberOfTimes; + + public boolean replace; + + public Misc(Integer numberOfTimes, boolean replace) { + this.numberOfTimes = numberOfTimes; + this.replace = replace; + } + } + public SimulatorRequest simulatorRequest; public SimulatorResponse simulatorResponse; + public Misc misc; - public RegistrationRequest(SimulatorRequest simulatorRequest, SimulatorResponse simulatorResponse) { + public RegistrationRequest(SimulatorRequest simulatorRequest, SimulatorResponse simulatorResponse, Misc misc) { this.simulatorRequest = simulatorRequest; this.simulatorResponse = simulatorResponse; + this.misc = misc; } + } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/model/Subscriber.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/model/Subscriber.java index 27f3f9bba..2f1d83f19 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/model/Subscriber.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/model/Subscriber.java @@ -3,6 +3,8 @@ package org.onap.simulator.presetGenerator.presets.model; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + public class Subscriber { @JsonProperty("global-customer-id") @@ -16,4 +18,7 @@ public class Subscriber { @JsonProperty("resource-version") public String resourceVersion; + + @JsonProperty("relationship-list") + public Map relationshipList; } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfiguration.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfiguration.java new file mode 100644 index 000000000..51aaaf5a3 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfiguration.java @@ -0,0 +1,61 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public class PresetMSOActivateFabricConfiguration extends BaseMSOPreset { + private final String serviceInstanceId; + 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 PresetMSOActivateFabricConfiguration() { + this(null, null); + } + + public PresetMSOActivateFabricConfiguration(String serviceInstanceId) { + this(serviceInstanceId, null); + } + + public PresetMSOActivateFabricConfiguration(String serviceInstanceId, String requestId) { + this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; + this.requestId = requestId != null ? requestId : DEFAULT_REQUEST_ID; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/activateFabricConfiguration"; + } + + @Override + public String getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelType\": \"service\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"" + + " }," + + " \"requestParameters\": {" + + " \"aLaCarte\": false" + + " }" + + " }" + + "}"; + } + + @Override + public Object getResponseBody() { + return "{\"requestReferences\":{\"instanceId\":\"" + serviceInstanceId + "\",\"requestId\":\"" + requestId + "\"}}"; + } + + @Override + public int getResponseCode() { + return 202; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfigurationErrorResponse.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfigurationErrorResponse.java new file mode 100644 index 000000000..92d45bf5b --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfigurationErrorResponse.java @@ -0,0 +1,62 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public class PresetMSOActivateFabricConfigurationErrorResponse extends BaseMSOPreset { + private final String serviceInstanceId; + private final int errorCode; + public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; + + public PresetMSOActivateFabricConfigurationErrorResponse() { + this(null, 0); + } + + public PresetMSOActivateFabricConfigurationErrorResponse(String serviceInstanceId) { + this(serviceInstanceId, 0); + } + + public PresetMSOActivateFabricConfigurationErrorResponse(String serviceInstanceId, int errorCode) { + this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; + this.errorCode = errorCode > 0 ? errorCode : 500; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/activateFabricConfiguration"; + } + + @Override + public String getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelType\": \"service\"" + + " }," + + " \"cloudConfiguration\": {" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"" + + " }," + + " \"requestParameters\": {" + + " \"aLaCarte\": false" + + " }" + + " }" + + "}"; + } + + @Override + public Object getResponseBody() { + return "{\"error\":\"222\",\"message\":\"error message\"}"; + } + + @Override + public int getResponseCode() { + return errorCode; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOAddOrRemoveOneInstanceGroupMember.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOAddOrRemoveOneInstanceGroupMember.java new file mode 100644 index 000000000..eba6be256 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOAddOrRemoveOneInstanceGroupMember.java @@ -0,0 +1,60 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOAddOrRemoveOneInstanceGroupMember extends PresetMSOBaseCreateInstancePost { + + public enum InstanceGroupMemberAction { + Add("/addMembers"), + Remove("/removeMembers"); + + private final String actionPath; + + InstanceGroupMemberAction(String actionPath) { + this.actionPath = actionPath; + } + + public String getActionPAth() { + return actionPath; + } + } + + + private final String memberInstanceId; + private final String userId; + private final InstanceGroupMemberAction action; + + public PresetMSOAddOrRemoveOneInstanceGroupMember(String vnfGroupInstanceId, String memberInstanceId, String userId, String requestId, InstanceGroupMemberAction action) { + super(requestId, vnfGroupInstanceId); + this.memberInstanceId = memberInstanceId; + this.userId = userId; + this.action = action; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./instanceGroups/" + responseInstanceId + action.getActionPAth(); + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"requestorId\": \"" + userId + "\"" + + " }," + + " \"relatedInstanceList\": [" + + " {" + + " \"relatedInstance\": {" + + " \"instanceId\": \"" + memberInstanceId + "\"," + + " \"modelInfo\": {" + + " \"modelType\": \"vnf\"" + + " }" + + " }" + + " }" + + " ]" + + " }" + + "}" + + ""; + } + +} 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 index 4d7b85027..6fc2182db 100644 --- 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 @@ -1,5 +1,7 @@ package org.onap.simulator.presetGenerator.presets.mso; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; + import java.util.Map; public class PresetMSOAssignServiceInstanceGen2WithNames extends PresetMSOServiceInstanceGen2WithNames { @@ -7,10 +9,11 @@ public class PresetMSOAssignServiceInstanceGen2WithNames extends PresetMSOServic public PresetMSOAssignServiceInstanceGen2WithNames(Map names, int suffix) { super(names, suffix); + this.cloudOwner = PresetAAIGetCloudOwnersByCloudRegionId.ATT_SABABA; } @Override public String getReqPath() { - return getRootPath() + "/serviceInstantiation/v7/serviceInstances/assign"; + return getRootPath() + "/serviceInstantiation/v./serviceInstances/assign"; } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseCreateInstancePost.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseCreateInstancePost.java new file mode 100644 index 000000000..05b8c8bec --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseCreateInstancePost.java @@ -0,0 +1,68 @@ +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; + +public abstract class PresetMSOBaseCreateInstancePost extends BaseMSOPreset { + + private final String requestId; + protected String responseInstanceId; + public static final String DEFAULT_REQUEST_ID = "c0011670-0e1a-4b74-945d-8bf5aede1d9c"; + protected String msoTestApi; + protected boolean withTestApi; + + public PresetMSOBaseCreateInstancePost() { + this(null); + } + + public PresetMSOBaseCreateInstancePost(String requestId) { + this.requestId = requestId != null ? requestId : DEFAULT_REQUEST_ID; + this.responseInstanceId = DEFAULT_INSTANCE_ID; + } + + public PresetMSOBaseCreateInstancePost(String requestId, String responseInstanceId) { + this.requestId = requestId != null ? requestId : DEFAULT_REQUEST_ID; + this.responseInstanceId = responseInstanceId; + } + + public PresetMSOBaseCreateInstancePost(String requestId, String responseInstanceId, String msoTestApi) { + this(requestId, responseInstanceId, msoTestApi, true); + } + + public PresetMSOBaseCreateInstancePost(String requestId, String responseInstanceId, String msoTestApi, boolean withTestApi) { + this(requestId, responseInstanceId); + this.msoTestApi = msoTestApi; + this.withTestApi= withTestApi; + } + + public String addTestApi() { + if(this.withTestApi) { + return "\"testApi\": \"" + msoTestApi + "\","; + } + return ""; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public int getResponseCode() { + return 202; + } + + public String getRequestId() { + return requestId; + } + + @Override + public Object getResponseBody() { + return "{\"requestReferences\":{\"instanceId\":\"" + responseInstanceId + "\",\"requestId\":\"" + requestId + "\"}}"; + } + + protected String formatSuffix(int suffix) { + return (suffix==0) ? StringUtils.EMPTY : "_" + String.format("%03d", suffix); + } +} 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 deleted file mode 100644 index 703829213..000000000 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseCreateServiceInstancePost.java +++ /dev/null @@ -1,34 +0,0 @@ -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 index 99433e0a2..e8ef7b51b 100644 --- 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 @@ -4,20 +4,25 @@ 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"; + protected final String requestId; + protected final String instanceId; - public PresetMSOBaseDelete() { - this(null ); - } + public static final String DEFAULT_REQUEST_ID = "c0011670-0e1a-4b74-945d-8bf5aede1d9c"; public PresetMSOBaseDelete(String requestId) { this.requestId = requestId != null ? requestId : DEFAULT_REQUEST_ID; + this.instanceId = DEFAULT_INSTANCE_ID; } + public PresetMSOBaseDelete(String requestId, String instanceId) { + this.requestId = requestId; + this.instanceId = instanceId; + } + + @Override protected String getRootPath() { - return super.getRootPath() + "/serviceInstances/v./"; + return super.getRootPath() + "/serviceInstantiation/v./serviceInstances/"; } @Override @@ -32,6 +37,6 @@ public abstract class PresetMSOBaseDelete extends BaseMSOPreset { @Override public Object getResponseBody() { - return "{\"requestReferences\":{\"instanceId\":\"f8791436-8d55-4fde-b4d5-72dd2cf13cfb\",\"requestId\":\"" + requestId + "\"}}"; + return "{\"requestReferences\":{\"instanceId\":\""+instanceId+"\",\"requestId\":\"" + requestId + "\"}}"; } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseDeleteWithCloudConfiguration.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseDeleteWithCloudConfiguration.java new file mode 100644 index 000000000..0c813641d --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOBaseDeleteWithCloudConfiguration.java @@ -0,0 +1,36 @@ +package org.onap.simulator.presetGenerator.presets.mso; + + +public abstract class PresetMSOBaseDeleteWithCloudConfiguration extends PresetMSOBaseDelete { + + private final String modelType; + + public PresetMSOBaseDeleteWithCloudConfiguration(String requestId, String modelType) { + super(requestId); + this.modelType = modelType; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelType\": \""+modelType+"\"" + + //" \"modelName\": \"\", //required for VfModule" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"requestParameters\": {" + + " \"testApi\": \"VNF_API\"" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"hvf6\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\"" + + " }" + + " }" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateMacroPre1806Post.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateMacroPre1806Post.java new file mode 100644 index 000000000..ed92767fa --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateMacroPre1806Post.java @@ -0,0 +1,63 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; + +public class PresetMSOCreateMacroPre1806Post extends PresetMSOBaseCreateInstancePost { + + public PresetMSOCreateMacroPre1806Post() { + this.cloudOwner = ATT_NC; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstances/v."; + } + + @Override + public Object getRequestBody() { + return "" + + "{" + + " \"requestDetails\": {" + + " \"requestInfo\": {" + + " \"instanceName\": \"New Instance Name\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"fi5777000\"," + + " \"productFamilyId\": \"e30755dc-5673-4b6b-9dcf-9abdd96b93d1\"" + + " }," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelInvariantId\": \"d27e42cf-087e-4d31-88ac-6c4b7585f800\"," + + " \"modelVersionId\": \"4d71990b-d8ad-4510-ac61-496288d9078e\"," + + " \"modelName\": \"vidmacrofalsenaming\"," + + " \"modelVersion\": \"1.0\"" + + " }," + + " \"requestParameters\": {" + + " \"userParams\": [" + + " {" + + " \"name\": \"aic_zone\"," + + " \"value\": \"NFT1\"" + + " }" + + " ]," + + " \"subscriptionServiceType\": \"AIM Transport\"," + + " \"aLaCarte\": false" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"olson3\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\"" + + " }," + + " \"subscriberInfo\": {" + + " \"globalSubscriberId\": \"31739f3e-526b-11e6-beb8-9e71128cae77\"" + + " }," + + " \"project\": {" + + " \"projectName\": \"yyy1\"" + + " }," + + " \"owningEntity\": {" + + " \"owningEntityId\": \"aaa1\"," + + " \"owningEntityName\": \"aaa1\"" + + " }" + + " }" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarte5G.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarte5G.java new file mode 100644 index 000000000..42b1578f4 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarte5G.java @@ -0,0 +1,79 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; + +public class PresetMSOCreateNetworkALaCarte5G extends PresetMSOBaseCreateInstancePost { + private String serviceInstanceId; + private String networkName; + private final String requestorId; + + + public PresetMSOCreateNetworkALaCarte5G(String overrideRequestId, String serviceInstanceId, String networkName, String requestorId) { + super(overrideRequestId); + this.serviceInstanceId = serviceInstanceId; + this.networkName = networkName; + this.requestorId = requestorId; + this.cloudOwner = PresetAAIGetCloudOwnersByCloudRegionId.ATT_AIC; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/networks"; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelCustomizationName\": \"SR-IOV Provider-1\"," + + " \"modelCustomizationId\": \"0a0287b1-74a3-4c40-9bbb-9f56601e4fc4\"," + + " \"modelInvariantId\": \"379f816b-a7aa-422f-be30-17114ff50b7c\"," + + " \"modelVersionId\": \"840ffc47-e4cf-46de-8e23-525fd8c6fdc3\"," + + " \"modelName\": \"ExtVL\"," + + " \"modelType\": \"network\"," + + " \"modelVersion\": \"49.0\"" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \""+PresetAAIGetCloudOwnersByCloudRegionId.SOME_LEGACY_REGION+"\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"092eb9e8e4b7412e8787dd091bc58e86\"," + + " }," + + " \"requestInfo\": {" + + " \"instanceName\": \""+networkName+"\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \""+requestorId+"\"" + + " }," + + " \"platform\": {" + + " \"platformName\": \"platform\"" + + " }," + + " \"lineOfBusiness\": {" + + " \"lineOfBusinessName\": \"ECOMP\"" + + " }," + + " \"relatedInstanceList\": [{" + + " \"relatedInstance\": {" + + " \"modelInfo\": {" + + " \"modelInvariantId\": \"16e56d12-40b3-4db1-a40e-d48c36679e2e\"," + + " \"modelVersionId\": \"4659e8bd-0920-4eed-8ec5-550b4c8dceeb\"," + + " \"modelName\": \"SR-IOV Provider-1\"," + + " \"modelType\": \"service\"," + + " \"modelVersion\": \"1.0\"" + + " }," + + " \"instanceId\": \""+serviceInstanceId+"\"" + + " }" + + " }" + + " ]," + + " \"requestParameters\": {" + + " \"testApi\": \"VNF_API\"," + + " \"userParams\": []" + + " }" + + " }" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteCypress.java new file mode 100644 index 000000000..273fc255f --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteCypress.java @@ -0,0 +1,68 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateNetworkALaCarteCypress extends PresetMSOBaseCreateInstancePost { + private final String networkInstanceName; + private final String serviceInstanceId; + + + public PresetMSOCreateNetworkALaCarteCypress(String overrideRequestId, String serviceInstanceId, String responseInstanceId, String networkInstanceName, String msoTestApi, boolean withTestApi) { + super(overrideRequestId, responseInstanceId, msoTestApi, withTestApi); + this.serviceInstanceId = serviceInstanceId; + this.networkInstanceName = networkInstanceName; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/networks"; + } + + @Override + public Object getRequestBody() { + return "{\"requestDetails\": {" + + + "\"modelInfo\":{" + + "\"modelCustomizationId\":\"94fdd893-4a36-4d70-b16a-ec29c54c184f\"," + + "\"modelCustomizationName\":\"ExtVL 0\"," + + "\"modelInvariantId\":\"379f816b-a7aa-422f-be30-17114ff50b7c\"," + + "\"modelName\":\"ExtVL\"," + + "\"modelVersion\":\"37.0\"," + + "\"modelVersionId\":\"ddc3f20c-08b5-40fd-af72-c6d14636b986\"," + + "\"modelType\":\"network\"" + + "}," + + "\"cloudConfiguration\":" + + "{\"lcpCloudRegionId\":\"lcpRegionText\"," + + addCloudOwnerIfNeeded() + + "\"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"}," + + "\"requestInfo\":" + + "{\"instanceName\":\""+ networkInstanceName +"\"," + + "\"productFamilyId\":\"ebc3bc3d-62fd-4a3f-a037-f619df4ff034\"," + + "\"source\":\"VID\"," + + "\"suppressRollback\":false," + + "\"requestorId\":\"us16807000\"}," + + //not sure it should be here + "\"platform\":{\"platformName\":\"xxx1\"}," + + //not sure it should be here + "\"lineOfBusiness\":{\"lineOfBusinessName\":\"zzz1\"}," + + + "\"relatedInstanceList\":[" + + "{\"relatedInstance\":{" + + "\"instanceId\":\""+serviceInstanceId+"\"," + + "\"modelInfo\":{" + + "\"modelVersionId\":\"2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd\"," + + "\"modelName\":\"action-data\"," + + "\"modelInvariantId\":\"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\"," + + "\"modelType\":\"service\"," + + "\"modelVersion\":\"1.0\"" + + "}}}]," + + + "\"requestParameters\":{" + + this.addTestApi() + + "\"userParams\":[]}" + + "}}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteOldViewEdit.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteOldViewEdit.java new file mode 100644 index 000000000..bccb07251 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteOldViewEdit.java @@ -0,0 +1,65 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateNetworkALaCarteOldViewEdit extends PresetMSOBaseCreateInstancePost { + private final String networkInstanceName; + private final String serviceInstanceId; + + public PresetMSOCreateNetworkALaCarteOldViewEdit(String overrideRequestId, String serviceInstanceId, String responseInstanceId, String networkInstanceName) { + super(overrideRequestId, responseInstanceId); + this.serviceInstanceId = serviceInstanceId; + this.networkInstanceName = networkInstanceName; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/networks"; + } + + @Override + public Object getRequestBody() { + return "{\"requestDetails\": {" + + " \"requestInfo\": {" + + " \"instanceName\": \""+networkInstanceName+"\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"mo57174000\"," + + " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" + + " }," + + " \"modelInfo\": {" + + " \"modelType\": \"network\"," + + " \"modelInvariantId\": \"de01afb5-532b-451d-aac4-ff9ff0644060\"," + + " \"modelVersionId\": \"ac815c68-35b7-4ea4-9d04-92d2f844b27c\"," + + " \"modelName\": \"AIC30_CONTRAIL_BASIC\"," + + " \"modelVersion\": \"3.0\"," + + " \"modelCustomizationId\": \"e94d61f7-b4b2-489a-a4a7-30b1a1a80daf\"," + + " \"modelCustomizationName\": \"AIC30_CONTRAIL_BASIC 0\"" + + " }," + + " \"requestParameters\": {" + + " \"testApi\": \"VNF_API\"," + + " \"userParams\": []" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"One\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"c630e297a3ae486497d63eacec1d7c14\"" + + " }," + + " \"platform\": {" + + " \"platformName\": \"xxx1\"" + + " }," + + " \"relatedInstanceList\": [" + + " {" + + " \"relatedInstance\": {" + + " \"instanceId\": \""+serviceInstanceId+"\"," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelName\": \"Using VID for VoIP Network Instantiations Shani\"," + + " \"modelInvariantId\": \"5b9c0f33-eec1-484a-bf77-736a6644d7a8\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelVersionId\": \"b75e0d22-05ff-4448-9266-5f0d4e1dbbd6\"" + + " }" + + " }" + + " }" + + " ]" + + " }}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteServiceCypress2.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteServiceCypress2.java new file mode 100644 index 000000000..356b59d9f --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteServiceCypress2.java @@ -0,0 +1,68 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateNetworkALaCarteServiceCypress2 extends PresetMSOBaseCreateInstancePost { + private String serviceInstanceId; + private String networkName; + private String serviceModelName; + private String serviceModelVersionId; + + + public PresetMSOCreateNetworkALaCarteServiceCypress2(String overrideRequestId, String serviceInstanceId, String networkName) { + this(overrideRequestId, serviceInstanceId, networkName, "ComplexService", "6e59c5de-f052-46fa-aa7e-2fca9d674c44"); + } + + public PresetMSOCreateNetworkALaCarteServiceCypress2(String overrideRequestId, String serviceInstanceId, String networkName, String serviceModelName, String serviceModelVersionId) { + super(overrideRequestId); + this.serviceInstanceId = serviceInstanceId; + this.networkName = networkName; + this.serviceModelName = serviceModelName; + this.serviceModelVersionId = serviceModelVersionId; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/networks"; + } + + @Override + public Object getRequestBody() { + return "{\"requestDetails\":" + + "{\"requestInfo\":" + + "{\"instanceName\":\"" + networkName + "\"," + + "\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"," + + "\"source\":\"VID\"," + + "\"suppressRollback\":false," + + "\"requestorId\":\"us16807000\"}," + + "\"lineOfBusiness\":{\"lineOfBusinessName\":\"zzz1\"}," + + "\"cloudConfiguration\":" + + "{\"lcpCloudRegionId\":\"hvf6\"," + + addCloudOwnerIfNeeded() + + "\"tenantId\":\"229bcdc6eaeb4ca59d55221141d01f8e\"}," + + "\"platform\":{\"platformName\":\"xxx1\"}," + + "\"modelInfo\":" + + "{\"modelCustomizationId\":\"94fdd893-4a36-4d70-b16a-ec29c54c184f\"," + + "\"modelCustomizationName\":\"ExtVL 0\"," + + "\"modelVersionId\":\"ddc3f20c-08b5-40fd-af72-c6d14636b986\"," + + "\"modelName\":\"ExtVL\"," + + "\"modelInvariantId\":\"379f816b-a7aa-422f-be30-17114ff50b7c\"," + + "\"modelType\":\"network\"," + + "\"modelVersion\":\"37.0\"}," + + "\"requestParameters\":{" + + "\"testApi\": \"GR_API\", " + + "\"userParams\":[]}," + + "\"relatedInstanceList\":[" + + "{\"relatedInstance\":{" + + "\"instanceId\":\"" + serviceInstanceId + "\"," + + "\"modelInfo\":{" + + "\"modelVersionId\":\"" + serviceModelVersionId + "\"," + + "\"modelName\":\"" + serviceModelName + "\"," + + "\"modelInvariantId\":\"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\"," + + "\"modelType\":\"service\"," + + "\"modelVersion\":\"1.0\"}}}]}}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork.java new file mode 100644 index 000000000..afd96a46f --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork.java @@ -0,0 +1,59 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; + +import java.util.Map; + +public class PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork extends PresetMSOCreateServiceInstanceGen2WithNames { + + private final String requestorId; + + public PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork(Map names, String requestId, String requestorId) { + super(names, 0, requestId); + this.requestorId = requestorId; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelInvariantId\": \"16e56d12-40b3-4db1-a40e-d48c36679e2e\"," + + " \"modelVersionId\": \"4659e8bd-0920-4eed-8ec5-550b4c8dceeb\"," + + " \"modelName\": \"SR-IOV Provider-1\"," + + " \"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\": \""+names.get(SERVICE_NAME)+"\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \""+this.requestorId+"\"" + + " }," + + " \"requestParameters\": {" + + " \"testApi\": \"VNF_API\"," + + " \"subscriptionServiceType\": \"TYLER SILVIA\"," + + " \"aLaCarte\": true," + + " \"userParams\": []" + + " }" + + " }" + + "}"; + + } + +} 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 index 3dbebd5e5..3a7b09b43 100644 --- 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 @@ -1,17 +1,15 @@ package org.onap.simulator.presetGenerator.presets.mso; -public class PresetMSOCreateServiceInstanceGen2 extends PresetMSOBaseCreateServiceInstancePost{ +public class PresetMSOCreateServiceInstanceGen2 extends PresetMSOBaseCreateInstancePost { - public PresetMSOCreateServiceInstanceGen2() { - } - - public PresetMSOCreateServiceInstanceGen2(String requestId) { - super(requestId); + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances"; } @Override - public String getReqPath() { - return getRootPath() + "/serviceInstantiation/v7/serviceInstances"; + public boolean isStrictMatch() { + return true; } @Override @@ -44,7 +42,7 @@ public class PresetMSOCreateServiceInstanceGen2 extends PresetMSOBaseCreateServi " \"requestorId\": \"us16807000\" " + " }, " + " \"requestParameters\": { " + - " \"subscriptionServiceType\": \"VIRTUAL USP\", " + + " \"subscriptionServiceType\": \"TYLER SILVIA\", " + " \"aLaCarte\": false, " + " \"userParams\": [{ " + " \"service\": { " + @@ -58,16 +56,17 @@ public class PresetMSOCreateServiceInstanceGen2 extends PresetMSOBaseCreateServi " \"resources\": { " + " \"vnfs\": [{ " + " \"modelInfo\": { " + - " \"modelCustomizationName\": \"2017-488_ADIOD-vPE 0\", " + + " \"modelCustomizationName\": \"2017-488_PASQUALE-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\", " + + " \"modelName\": \"2017-488_PASQUALE-vPE\", " + " \"modelType\": \"vnf\", " + " \"modelVersion\": \"5.0\" " + " }, " + " \"cloudConfiguration\": { " + - " \"lcpCloudRegionId\": \"mtn6\", " + + " \"lcpCloudRegionId\": \"hvf6\", " + + addCloudOwnerIfNeeded() + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\" " + " }, " + " \"platform\": { " + @@ -78,19 +77,20 @@ public class PresetMSOCreateServiceInstanceGen2 extends PresetMSOBaseCreateServi " }, " + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + " \"instanceParams\": [], " + - " \"vfModules\": [{ " + + " \"vfModules\": [" + + " { " + " \"modelInfo\": { " + " \"modelInvariantId\": \"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\", " + " \"modelVersionId\": \"25284168-24bb-4698-8cb4-3f509146eca5\", " + - " \"modelName\": \"2017488AdiodVpe..ADIOD_vRE_BV..module-1\", " + + " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + " \"modelType\": \"vfModule\", " + " \"modelVersion\": \"6\" " + " }, " + -// " \"instanceName\": \"VFinstancename_00" + suffix + "\", " + +// \"instanceName\": \"VFinstancename_00" + suffix + "\", " + " \"instanceParams\": [] " + - " } " + + " }" + " ] " + -// " \"instanceName\": \"2017488_ADIODvPEVNFinstancename_00" + suffix + "\" " + +// " \"instanceName\": \"2017488_PASQUALEvPEVNFinstancename_00" + suffix + "\" " + " } " + " ] " + " } " + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2AlacarteService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2AlacarteService.java new file mode 100644 index 000000000..f76293f1d --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2AlacarteService.java @@ -0,0 +1,55 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import java.util.Map; + +public class PresetMSOCreateServiceInstanceGen2AlacarteService extends PresetMSOCreateServiceInstanceGen2WithNames { + + public PresetMSOCreateServiceInstanceGen2AlacarteService(Map names, int suffix, String requestId) { + super(names, suffix, requestId); + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public Object getRequestBody() { + return "" + + "{ " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"16e56d12-40b3-4db1-a40e-d48c36679e2e\", " + + " \"modelVersionId\": \"4659e8bd-0920-4eed-8ec5-550b4c8dceeb\", " + + " \"modelName\": \"SR-IOV Provider-1\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"owningEntity\": { " + + " \"owningEntityName\": \"MetroPacketCore\", " + + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\" " + + " }, " + + " \"project\": { " + + " \"projectName\": \"DFW\" " + + " }, " + + " \"subscriberInfo\": { " + + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + + " }, " + + " \"requestInfo\": { " + + " \"source\": \"VID\", " + + " \"suppressRollback\": false, " + + " \"instanceName\": \"" + names.get(Keys.SERVICE_NAME) + suffix + "\", " + + " \"requestorId\": \"us16807000\" " + + " }, " + + " \"requestParameters\": { " + + " \"testApi\": \"VNF_API\", " + + " \"subscriptionServiceType\": \"TYLER SILVIA\", " + + " \"aLaCarte\": true, " + + " \"userParams\": [] " + + " } " + + " } " + + "} "; + + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2ErrorResponse.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2ErrorResponse.java new file mode 100644 index 000000000..a8b4d9aa5 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2ErrorResponse.java @@ -0,0 +1,24 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateServiceInstanceGen2ErrorResponse extends PresetMSOBaseCreateInstancePost { + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances"; + } + + @Override + public int getResponseCode() { + return 500; + } + + @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/PresetMSOCreateServiceInstanceGen2WithNames.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNames.java index 89008b99b..f9124cc75 100644 --- 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 @@ -1,15 +1,27 @@ package org.onap.simulator.presetGenerator.presets.mso; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; + import java.util.Map; public class PresetMSOCreateServiceInstanceGen2WithNames extends PresetMSOServiceInstanceGen2WithNames { public PresetMSOCreateServiceInstanceGen2WithNames(Map names, int suffix) { super(names, suffix); + this.cloudOwner = PresetAAIGetCloudOwnersByCloudRegionId.ATT_SABABA; + } + + public PresetMSOCreateServiceInstanceGen2WithNames(Map names, int suffix, String requestId) { + super(names, suffix, requestId); } + public PresetMSOCreateServiceInstanceGen2WithNames(Map names, int suffix, String requestId, String responseInstanceId) { + super(names, suffix, requestId, responseInstanceId); + } + + @Override public String getReqPath() { - return getRootPath() + "/serviceInstantiation/v7/serviceInstances"; + return getRootPath() + "/serviceInstantiation/v./serviceInstances"; } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService.java new file mode 100644 index 000000000..8f0b14115 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService.java @@ -0,0 +1,63 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import java.util.Map; + +public class PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService extends PresetMSOCreateServiceInstanceGen2WithNames { + + private String userId = "us16807000"; + + public PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService(Map names, int suffix, String requestId) { + super(names, suffix, requestId); + } + + public PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService(Map names, int suffix, String requestId, String responseInstanceId, String userId) { + super(names, suffix, requestId); + this.responseInstanceId = responseInstanceId; + this.userId = userId; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public Object getRequestBody() { + return "" + + "{ " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"7ee41ce4-4827-44b0-a48e-2707a59905d2\", " + + " \"modelVersionId\": \"4117a0b6-e234-467d-b5b9-fe2f68c8b0fc\", " + + " \"modelName\": \"Grouping Service for Test\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"owningEntity\": { " + + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\", " + + " \"owningEntityName\": \"MetroPacketCore\" " + + " }, " + + " \"project\": { " + + " \"projectName\": \"DFW\" " + + " }, " + + " \"subscriberInfo\": { " + + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + + " }, " + + " \"requestInfo\": { " + + " \"source\": \"VID\", " + + " \"suppressRollback\": false, " + + " \"instanceName\": \"" + names.get(Keys.SERVICE_NAME) + suffix + "\", " + + " \"requestorId\": \"" + userId + "\" " + + " }, " + + " \"requestParameters\": { " + + " \"testApi\": \"VNF_API\", " + + " \"subscriptionServiceType\": \"TYLER SILVIA\", " + + " \"aLaCarte\": true, " + + " \"userParams\": [] " + + " } " + + " } " + + "} "; + + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteService.java new file mode 100644 index 000000000..cc33a3b14 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteService.java @@ -0,0 +1,60 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import java.util.Map; + +public class PresetMSOCreateServiceInstanceGen2WithNamesAlacarteService extends PresetMSOCreateServiceInstanceGen2WithNames { + + public PresetMSOCreateServiceInstanceGen2WithNamesAlacarteService(Map names, int suffix, String requestId) { + super(names, suffix, requestId); + } + + public PresetMSOCreateServiceInstanceGen2WithNamesAlacarteService(Map names, int suffix, String requestId, String responseInstanceId) { + super(names, suffix, requestId, responseInstanceId); + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public Object getRequestBody() { + return "" + + "{ " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"0367689e-d41e-483f-b200-eab17e4a7f8d\", " + + " \"modelVersionId\": \"e3c34d88-a216-4f1d-a782-9af9f9588705\", " + + " \"modelName\": \"gayawabawe\", " + + " \"modelVersion\": \"5.1\" " + + " }, " + + " \"owningEntity\": { " + + " \"owningEntityId\": \"038d99af-0427-42c2-9d15-971b99b9b489\", " + + " \"owningEntityName\": \"Lucine Sarika\" " + + " }, " + + " \"project\": { " + + " \"projectName\": \"zasaki\" " + + " }, " + + " \"subscriberInfo\": { " + + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + + " }, " + + " \"requestInfo\": { " + + " \"source\": \"VID\", " + + " \"suppressRollback\": true, " + + " \"instanceName\": \"" + names.get(Keys.SERVICE_NAME) + suffix + "\", " + + " \"productFamilyId\": \"ddf9cc0f-6331-4d35-bed0-a37f2d5e9cb3\", " + + " \"requestorId\": \"us16807000\" " + + " }, " + + " \"requestParameters\": { " + + " \"testApi\": \"VNF_API\", " + + " \"subscriptionServiceType\": \"TYLER SILVIA\", " + + " \"aLaCarte\": true, " + + " \"userParams\": [] " + + " } " + + " } " + + "} "; + + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress.java new file mode 100644 index 000000000..a864b0d10 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress.java @@ -0,0 +1,58 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import java.util.Map; + +public class PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress extends PresetMSOCreateServiceInstanceGen2WithNames { + + public PresetMSOCreateServiceInstanceGen2WithNamesAlacarteServiceCypress(Map names, int suffix, String requestId, String testApi, boolean withTestApi) { + super(names, suffix, requestId); + this.msoTestApi = testApi; + this.withTestApi = withTestApi; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public Object getRequestBody() { + return "" + + "{ " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\", " + + " \"modelVersionId\": \"2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd\", " + + " \"modelName\": \"action-data\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"owningEntity\": { " + + " \"owningEntityName\": \"MetroPacketCore\", " + + " \"owningEntityId\": \"d61e6f2d-12fa-4cc2-91df-7c244011d6fc\" " + + " }, " + + " \"project\": { " + + " \"projectName\": \"DFW\" " + + " }, " + + " \"subscriberInfo\": { " + + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + + " }, " + + " \"requestInfo\": { " + + " \"source\": \"VID\", " + + " \"suppressRollback\": false, " + + " \"productFamilyId\": \"ebc3bc3d-62fd-4a3f-a037-f619df4ff034\", " + + " \"instanceName\": \"" + names.get(Keys.SERVICE_NAME) + suffix + "\", " + + " \"requestorId\": \"us16807000\" " + + " }, " + + " \"requestParameters\": { " + + addTestApi()+ + " \"subscriptionServiceType\": \"TYLER SILVIA\", " + + " \"aLaCarte\": true, " + + " \"userParams\": [] " + + " } " + + " } " + + "} "; + + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse.java new file mode 100644 index 000000000..2a8d7586e --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse.java @@ -0,0 +1,327 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VFM_NAME1; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VFM_NAME2; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VG_NAME; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VNF_NAME; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VNF_NAME2; + +import java.util.Map; +import vid.automation.test.infra.Features; + +public class PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse extends PresetMSOCreateServiceInstanceGen2WithNames { + + protected static final String INSTANCE_PARAMS_VNF = "{ " + + " \"bandwidth\": \"10\", " + + " \"vnf_instance_name\": \"mtnj309me6\", " + + " \"vnf_config_template_version\": \"17.2\", " + + " \"AIC_CLLI\": \"ATLMY8GA\", " + + " \"ASN\": \"AV_vPE\", " + + " \"bandwidth_units\": \"Gbps\" " + + " }"; + + protected static final String INSTANCE_PARAMS_WITH_SUPP_FILE_VNF = "{ " + + " \"vnf_config_template_version\": \"17.2\", " + + " \"AIC_CLLI\": \"ATLMY8GA\", " + + " \"bandwidth\": \"10\", " + + " \"bandwidth_units\": \"Gbps\", " + + " \"ASN\": \"AV_vPE\", " + + " \"param\": \"ABCD\", " + + " \"vnf_instance_name\": \"sample\" " + + " }"; + + protected static final String INSTANCE_PARAMS_VF_MODULE = "{ " + + " \"bandwidth\": \"10\", " + + " \"vnf_instance_name\": \"mtnj309me6\", " + + " \"vnf_config_template_version\": \"17.2\", " + + " \"AIC_CLLI\": \"ATLMY8GA\", " + + " \"bandwidth_units\": \"Gbps\" " + + " }"; + + protected static final String INSTANCE_PARAMS_WITH_SUPP_FILE_VF_MODULE = "{ " + + " \"vnf_config_template_version\": \"17.2\", " + + " \"AIC_CLLI\": \"ATLMY8GA\", " + + " \"bandwidth\": \"10\", " + + " \"bandwidth_units\": \"Gbps\", " + + " \"param\": \"ABCD\", " + + " \"vnf_instance_name\": \"sample\" " + + " }"; + + + + public PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse(Map names, int suffix, String requestId) { + super(names, suffix, requestId); + } + + @Override + public boolean isStrictMatch() { + return false; + } + + protected String getVnfInstanceParams() { + if (!Features.FLAG_SHIFT_VFMODULE_PARAMS_TO_VNF.isActive()) { + return ""; + } + + if (Features.FLAG_SUPPLEMENTARY_FILE.isActive()) { + return INSTANCE_PARAMS_WITH_SUPP_FILE_VNF; + } + return INSTANCE_PARAMS_VNF; + } + + protected String getVFModuleInstanceParams() { + if (Features.FLAG_SUPPLEMENTARY_FILE.isActive()) { + return INSTANCE_PARAMS_WITH_SUPP_FILE_VF_MODULE; + } + return INSTANCE_PARAMS_VF_MODULE; + } + + @Override + public Object getRequestBody() { + return "" + + "{ " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelInvariantId\": \"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\", " + + " \"modelVersionId\": \"6b528779-44a3-4472-bdff-9cd15ec93450\", " + + " \"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\": \"" + names.get(SERVICE_NAME) + suffix + "\", " + + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + + " \"source\": \"VID\", " + + " \"suppressRollback\": false, " + + " \"requestorId\": \"us16807000\" " + + " }, " + + " \"requestParameters\": { " + + " \"subscriptionServiceType\": \"TYLER SILVIA\", " + + " \"aLaCarte\": false, " + + " \"userParams\": [{ " + + " \"service\": { " + + " \"instanceName\": \"" + names.get(SERVICE_NAME) + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelVersionId\": \"6b528779-44a3-4472-bdff-9cd15ec93450\", " + + " \"modelName\": \"action-data\", " + + " \"modelType\": \"service\" " + + " }, " + + " \"instanceParams\": [{ " + + " \"2017488_PASQUALEvpe0_ASN\": \"AV_vPE\"" + + " }" + + " ], " + + " \"resources\": { " + + " \"vnfs\": [{ " + + " \"instanceName\": \"" + names.get(VNF_NAME2) + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017-388_PASQUALE-vPE 0\", " + + " \"modelCustomizationId\": \"b3c76f73-eeb5-4fb6-9d31-72a889f1811c\", " + + " \"modelInvariantId\": \"72e465fe-71b1-4e7b-b5ed-9496118ff7a8\", " + + " \"modelVersionId\": \"afacccf6-397d-45d6-b5ae-94c39734b168\", " + + " \"modelName\": \"2017-388_PASQUALE-vPE\", " + + " \"modelType\": \"vnf\", " + + " \"modelVersion\": \"4.0\" " + + " }, " + + " \"cloudConfiguration\": { " + + " \"lcpCloudRegionId\": \"hvf6\", " + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\" " + + " }, " + + " \"platform\": { " + + " \"platformName\": \"platform\" " + + " }, " + + " \"lineOfBusiness\": { " + + " \"lineOfBusinessName\": \"ECOMP\" " + + " }, " + + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + + " \"instanceParams\": [" + INSTANCE_PARAMS_VNF + "] " + + " }," + + " { " + //start of vnf + " \"instanceName\": \"" + names.get(VNF_NAME) + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017-488_PASQUALE-vPE 0\", " + + " \"modelCustomizationId\": \"1da7b585-5e61-4993-b95e-8e6606c81e45\", " + + " \"modelInvariantId\": \"72e465fe-71b1-4e7b-b5ed-9496118ff7a8\", " + + " \"modelVersionId\": \"69e09f68-8b63-4cc9-b9ff-860960b5db09\", " + + " \"modelName\": \"2017-488_PASQUALE-vPE\", " + + " \"modelType\": \"vnf\", " + + " \"modelVersion\": \"5.0\" " + + " }, " + + " \"cloudConfiguration\": { " + + " \"lcpCloudRegionId\": \"hvf6\", " + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\" " + + " }, " + + " \"platform\": { " + + " \"platformName\": \"platform\" " + + " }, " + + " \"lineOfBusiness\": { " + + " \"lineOfBusinessName\": \"ECOMP\" " + + " }, " + + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + + " \"instanceParams\": [" + getVnfInstanceParams() + "], " + + " \"vfModules\": [{ " + + " \"instanceName\": \"" + names.get(VFM_NAME1) + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelCustomizationId\": \"a55961b2-2065-4ab0-a5b7-2fcee1c227e3\", " + + " \"modelInvariantId\": \"b34833bb-6aa9-4ad6-a831-70b06367a091\", " + + " \"modelVersionId\": \"f8360508-3f17-4414-a2ed-6bc71161e8db\", " + + " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelType\": \"vfModule\", " + + " \"modelVersion\": \"5\" " + + " }, " + + " \"instanceParams\": [] " + + " }, { " + + " \"instanceName\": \"" + names.get(VFM_NAME2) + suffix + "\", " + + " \"volumeGroupInstanceName\": \"" + names.get(VG_NAME) + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelCustomizationId\": \"f7e7c365-60cf-49a9-9ebf-a1aa11b9d401\", " + + " \"modelInvariantId\": \"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\", " + + " \"modelVersionId\": \"25284168-24bb-4698-8cb4-3f509146eca5\", " + + " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelType\": \"vfModule\", " + + " \"modelVersion\": \"6\" " + + " }, " + + " \"instanceParams\": [" + getVFModuleInstanceParams() + "] " + + " }" + //end of vfModule + " ] " + //end of vfModules list + " }" + //end of vnf + addDuplicatedVnfIfFeatureOn() + + " ] " + //end of vnf list + " } " + + " } " + + " } " + + " ] " + + " } " + + " } " + + "}"; + + } + + private String addDuplicatedVnfIfFeatureOn() { + if (!Features.FLAG_DUPLICATE_VNF.isActive()) { + return ""; + } + + return + " ,{ " + //start of vnf + " \"instanceName\": \"" + names.get(VNF_NAME)+ "_001" + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017-488_PASQUALE-vPE 0\", " + + " \"modelCustomizationId\": \"1da7b585-5e61-4993-b95e-8e6606c81e45\", " + + " \"modelInvariantId\": \"72e465fe-71b1-4e7b-b5ed-9496118ff7a8\", " + + " \"modelVersionId\": \"69e09f68-8b63-4cc9-b9ff-860960b5db09\", " + + " \"modelName\": \"2017-488_PASQUALE-vPE\", " + + " \"modelType\": \"vnf\", " + + " \"modelVersion\": \"5.0\" " + + " }, " + + " \"cloudConfiguration\": { " + + " \"lcpCloudRegionId\": \"hvf6\", " + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\" " + + " }, " + + " \"platform\": { " + + " \"platformName\": \"platform\" " + + " }, " + + " \"lineOfBusiness\": { " + + " \"lineOfBusinessName\": \"ECOMP\" " + + " }, " + + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + + " \"instanceParams\": [" + getVnfInstanceParams() + "], " + + " \"vfModules\": [{ " + + " \"instanceName\": \"" + names.get(VFM_NAME1) + "_001" + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelCustomizationId\": \"a55961b2-2065-4ab0-a5b7-2fcee1c227e3\", " + + " \"modelInvariantId\": \"b34833bb-6aa9-4ad6-a831-70b06367a091\", " + + " \"modelVersionId\": \"f8360508-3f17-4414-a2ed-6bc71161e8db\", " + + " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelType\": \"vfModule\", " + + " \"modelVersion\": \"5\" " + + " }, " + + " \"instanceParams\": [] " + + " }, { " + + " \"instanceName\": \"" + names.get(VFM_NAME2) + "_001" + suffix + "\", " + + " \"volumeGroupInstanceName\": \"" + names.get(VG_NAME) + "_001" + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelCustomizationId\": \"f7e7c365-60cf-49a9-9ebf-a1aa11b9d401\", " + + " \"modelInvariantId\": \"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\", " + + " \"modelVersionId\": \"25284168-24bb-4698-8cb4-3f509146eca5\", " + + " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelType\": \"vfModule\", " + + " \"modelVersion\": \"6\" " + + " }, " + + " \"instanceParams\": [" + getVFModuleInstanceParams() + "] " + + " }" + //end of vfModule + " ] " + //end of vfModules list + " }" + //end of vnf + " ,{ " + //start of vnf + " \"instanceName\": \"" + names.get(VNF_NAME)+ "_002" + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017-488_PASQUALE-vPE 0\", " + + " \"modelCustomizationId\": \"1da7b585-5e61-4993-b95e-8e6606c81e45\", " + + " \"modelInvariantId\": \"72e465fe-71b1-4e7b-b5ed-9496118ff7a8\", " + + " \"modelVersionId\": \"69e09f68-8b63-4cc9-b9ff-860960b5db09\", " + + " \"modelName\": \"2017-488_PASQUALE-vPE\", " + + " \"modelType\": \"vnf\", " + + " \"modelVersion\": \"5.0\" " + + " }, " + + " \"cloudConfiguration\": { " + + " \"lcpCloudRegionId\": \"hvf6\", " + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\" " + + " }, " + + " \"platform\": { " + + " \"platformName\": \"platform\" " + + " }, " + + " \"lineOfBusiness\": { " + + " \"lineOfBusinessName\": \"ECOMP\" " + + " }, " + + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\", " + + " \"instanceParams\": [" + getVnfInstanceParams() + "], " + + " \"vfModules\": [{ " + + " \"instanceName\": \"" + names.get(VFM_NAME1) + "_002" + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelCustomizationId\": \"a55961b2-2065-4ab0-a5b7-2fcee1c227e3\", " + + " \"modelInvariantId\": \"b34833bb-6aa9-4ad6-a831-70b06367a091\", " + + " \"modelVersionId\": \"f8360508-3f17-4414-a2ed-6bc71161e8db\", " + + " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\", " + + " \"modelType\": \"vfModule\", " + + " \"modelVersion\": \"5\" " + + " }, " + + " \"instanceParams\": [] " + + " }, { " + + " \"instanceName\": \"" + names.get(VFM_NAME2) + "_002" + suffix + "\", " + + " \"volumeGroupInstanceName\": \"" + names.get(VG_NAME) + "_002" + suffix + "\", " + + " \"modelInfo\": { " + + " \"modelCustomizationName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelCustomizationId\": \"f7e7c365-60cf-49a9-9ebf-a1aa11b9d401\", " + + " \"modelInvariantId\": \"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\", " + + " \"modelVersionId\": \"25284168-24bb-4698-8cb4-3f509146eca5\", " + + " \"modelName\": \"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\", " + + " \"modelType\": \"vfModule\", " + + " \"modelVersion\": \"6\" " + + " }, " + + " \"instanceParams\": [" + getVFModuleInstanceParams() + "] " + + " }" + //end of vfModule + " ] " + //end of vfModules list + " }" ; //end of vnf + } + + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceMultipleVnfsServiceCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceMultipleVnfsServiceCypress.java new file mode 100644 index 000000000..065050a63 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateServiceInstanceMultipleVnfsServiceCypress.java @@ -0,0 +1,56 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import java.util.Map; + +public class PresetMSOCreateServiceInstanceMultipleVnfsServiceCypress extends PresetMSOCreateServiceInstanceGen2WithNames { + + public PresetMSOCreateServiceInstanceMultipleVnfsServiceCypress(Map names, int suffix, String requestId) { + super(names, suffix, requestId); + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public Object getRequestBody() { + return "" + + "{ " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\", " + + " \"modelVersionId\": \"6e59c5de-f052-46fa-aa7e-2fca9d674c44\", " + + " \"modelName\": \"ComplexService\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"owningEntity\": { " + + " \"owningEntityName\": \"aaa1\", " + + " \"owningEntityId\": \"aaa1\" " + + " }, " + + " \"project\": { " + + " \"projectName\": \"yyy1\" " + + " }, " + + " \"subscriberInfo\": { " + + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\" " + + " }, " + + " \"requestInfo\": { " + + " \"source\": \"VID\", " + + " \"suppressRollback\": false, " + + " \"productFamilyId\": \"36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e\", " + + " \"instanceName\": \"" + names.get(Keys.SERVICE_NAME) + suffix + "\", " + + " \"requestorId\": \"us16807000\" " + + " }, " + + " \"requestParameters\": { " + + " \"testApi\": \"GR_API\", " + + " \"subscriptionServiceType\": \"TYLER SILVIA\", " + + " \"aLaCarte\": true, " + + " \"userParams\": [] " + + " } " + + " } " + + "} "; + + } + +} 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 index 931fe59e3..39b415fa2 100644 --- 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 @@ -3,10 +3,10 @@ package org.onap.simulator.presetGenerator.presets.mso; /** * Created by itzikliderman on 13/12/2017. */ -public class PresetMSOCreateServiceInstancePost extends PresetMSOBaseCreateServiceInstancePost { +public class PresetMSOCreateServiceInstancePost extends PresetMSOBaseCreateInstancePost { public String getReqPath() { - return getRootPath() + "/serviceInstances/v6"; + return getRootPath() + "/serviceInstances/v."; } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVNFInstanceOnlyRelatedServiceInstance.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVNFInstanceOnlyRelatedServiceInstance.java new file mode 100644 index 000000000..f203a7df6 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVNFInstanceOnlyRelatedServiceInstance.java @@ -0,0 +1,74 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; + +public class PresetMSOCreateVNFInstanceOnlyRelatedServiceInstance extends PresetMSOBaseCreateInstancePost { + private final String suffix; + private String serviceInstanceId; + private String vnfInstanceName; + + public PresetMSOCreateVNFInstanceOnlyRelatedServiceInstance(String vnfInstanceName, String vnfRequestId, String serviceInstanceId, String vnfInstanceId, int suffix) { + super(vnfRequestId, vnfInstanceId); + this.vnfInstanceName = vnfInstanceName; + this.serviceInstanceId = serviceInstanceId; + this.cloudOwner = PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; + this.suffix = formatSuffix(suffix); + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs"; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelType\": \"vnf\"," + + " \"modelInvariantId\": \"ff5256d1-5a33-55df-13ab-12abad84e7ff\"," + + " \"modelVersionId\": \"fe042c22-ba82-43c6-b2f6-8f1fc4164091\"," + + " \"modelName\": \"vSAMP12\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelCustomizationName\": \"vSAMP12 1\"," + + " \"modelCustomizationId\": \"a7f1d08e-b02d-11e6-80f5-76304dec7eb7\"" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"mdt1\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + + " }," + + " \"requestInfo\": {" + + " \"instanceName\": \"" + vnfInstanceName+suffix + "\"," + + " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": true," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"platform\": {" + + " \"platformName\": \"vnf_platformName\"" + + " }," + + " \"lineOfBusiness\": {" + + " \"lineOfBusinessName\": \"vnf_lineOfBusinessName\"" + + " }," + + " \"relatedInstanceList\": [" + + " {" + + " \"relatedInstance\": {" + + " \"instanceId\": \"" + serviceInstanceId + "\"," + + " \"modelInfo\": {" + + " \"modelInvariantId\": \"0367689e-d41e-483f-b200-eab17e4a7f8d\"," + + " \"modelVersionId\": \"e3c34d88-a216-4f1d-a782-9af9f9588705\"," + + " \"modelName\": \"gayawabawe\"," + + " \"modelVersion\": \"5.1\"" + + " }" + + " }" + + " }" + + " ]," + + " \"requestParameters\": {" + + " \"userParams\": []," + + " \"testApi\": \"VNF_API\"" + + " }" + + " }" + + "}"; + } +} 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 deleted file mode 100644 index 443d78e81..000000000 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVNFInstancePost.java +++ /dev/null @@ -1,21 +0,0 @@ -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/PresetMSOCreateVfModule.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModule.java new file mode 100644 index 000000000..72538fc11 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModule.java @@ -0,0 +1,78 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVfModule extends PresetMSOBaseCreateInstancePost { + private String serviceInstanceId; + private String vnfInstanceId; + private String instanceName; + private String modelVersionId; + private String modelInvariantId; + private String serviceName; + + public PresetMSOCreateVfModule(String serviceInstanceId, String vnfInstanceId, String cloudOwner) { + this(serviceInstanceId, vnfInstanceId, cloudOwner, "aa", "240376de-870e-48df-915a-31f140eedd2c", + "709d1be4-9a3f-4a29-8c4d-a20465e808a3", "Demo Service 1"); + } + + public PresetMSOCreateVfModule(String serviceInstanceId, String vnfInstanceId, + String cloudOwner, String instanceName, String modelVersionId, String modelInvariantId, String serviceName) { + this.serviceInstanceId = serviceInstanceId; + this.vnfInstanceId = vnfInstanceId; + this.cloudOwner = cloudOwner; + this.instanceName = instanceName; + this.modelVersionId = modelVersionId; + this.modelInvariantId = modelInvariantId; + this.serviceName = serviceName; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/"+vnfInstanceId+"/vfModules"; + } + + @Override + public Object getRequestBody() { + return "{" + + "\"requestDetails\":{" + + "\"requestInfo\":{" + + "\"instanceName\":\"" + instanceName + "\"," + + "\"source\":\"VID\"," + + "\"suppressRollback\":false," + + "\"requestorId\":\"us16807000\"" + + "}," + + "\"modelInfo\":{" + + "\"modelType\":\"vfModule\"," + + "\"modelInvariantId\":\"\"," + + "\"modelVersionId\":\"\"," + + "\"modelName\":\"\"," + + "\"modelVersion\":\"\"," + + "\"modelCustomizationId\":\"\"," + + "\"modelCustomizationName\":\"\"" + + "}," + + "\"requestParameters\":{" + + "\"userParams\":[" + + "]," + + "\"usePreload\":false" + + "}," + + "\"cloudConfiguration\":{" + + "\"lcpCloudRegionId\":\"mdt1\"," + + addCloudOwnerIfNeeded() + + "\"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"" + + "}," + + "\"relatedInstanceList\":[" + + "{" + + "\"relatedInstance\":{" + + "\"instanceId\":\"" + serviceInstanceId + "\","+ + "\"modelInfo\":{" + + "\"modelType\":\"service\"," + + "\"modelName\":\"" + serviceName + "\","+ + "\"modelInvariantId\":\"" + modelInvariantId + "\","+ + "\"modelVersion\":\"1.0\"," + + "\"modelVersionId\":\"" + modelVersionId + "\"" + + "}" + + "}" + + "}" + + "]" + + "}" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java new file mode 100644 index 000000000..dabc526c7 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java @@ -0,0 +1,115 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import com.google.common.collect.ImmutableMap; +import java.util.Map; + +public class PresetMSOCreateVfModuleALaCarteCypress extends PresetMSOBaseCreateInstancePost { + private String serviceInstanceId; + private String vnfInstanceId; + protected final Map names; + + public enum Keys { + modelVersionId, modelName, modelVersion, modelCustomizationId, modelCustomizationName, instanceName, modelInvariantId + } + + public static final Map module0Names = ImmutableMap.builder() + .put(Keys.instanceName, "mimazepubi") + .put(Keys.modelInvariantId, "b34833bb-6aa9-4ad6-a831-70b06367a091") + .put(Keys.modelVersionId, "f8360508-3f17-4414-a2ed-6bc71161e8db") + .put(Keys.modelName, "2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0") + .put(Keys.modelVersion, "5") + .put(Keys.modelCustomizationId, "a55961b2-2065-4ab0-a5b7-2fcee1c227e3") + .put(Keys.modelCustomizationName, "2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0") + .build(); + + public static final Map module2Names = ImmutableMap.builder() + .put(Keys.instanceName, "bnmgtrx") + .put(Keys.modelInvariantId, "eff8cc59-53a1-4101-aed7-8cf24ecf8339") + .put(Keys.modelVersionId, "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a") + .put(Keys.modelName, "2017488PASQUALEVpe..PASQUALE_vPFE_BV..module-2") + .put(Keys.modelVersion, "6") + .put(Keys.modelCustomizationId, "3cd946bb-50e0-40d8-96d3-c9023520b557") + .put(Keys.modelCustomizationName, "2017488PASQUALEVpe..PASQUALE_vPFE_BV..module-2") + .build(); + + public PresetMSOCreateVfModuleALaCarteCypress(String overrideRequestId, String serviceInstanceId, String vnfInstanceId, Map names, String testApi, boolean withTestApi) { + super(overrideRequestId); + this.vnfInstanceId = vnfInstanceId; + this.serviceInstanceId = serviceInstanceId; + this.names = names; + this.msoTestApi = testApi; + this.withTestApi = withTestApi; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/vfModules"; + } + + @Override + public Object getRequestBody() { + return "" + + "{" + + " \"requestDetails\":{" + + " \"modelInfo\":{" + + " \"modelType\":\"vfModule\"," + + " \"modelInvariantId\":\"" + names.get(Keys.modelInvariantId) + "\"," + + " \"modelVersionId\":\"" + names.get(Keys.modelVersionId) + "\"," + + " \"modelName\":\"" + names.get(Keys.modelName) + "\"," + + " \"modelVersion\":\"" + names.get(Keys.modelVersion) + "\"," + + " \"modelCustomizationId\":\"" + names.get(Keys.modelCustomizationId) + "\"," + + " \"modelCustomizationName\":\"" + names.get(Keys.modelCustomizationName) + "\"" + + " }," + + " \"cloudConfiguration\":{" + + " \"lcpCloudRegionId\":\"hvf6\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\":\"624eb554b0d147c19ff8885341760481\"" + + + " }," + + " \"requestInfo\":{" + + " \"instanceName\":\"" + names.get(Keys.instanceName) + "\"," + + " \"source\":\"VID\"," + + " \"suppressRollback\":true," + + " \"requestorId\":\"us16807000\"" + + " }," + + " \"relatedInstanceList\":[{" + + " \"relatedInstance\":{" + + " \"instanceId\":\"" + serviceInstanceId + "\"," + + " \"modelInfo\":{" + + " \"modelType\":\"service\"," + + " \"modelName\":\"action-data\"," + + " \"modelInvariantId\":\"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\"," + + " \"modelVersion\":\"1.0\"," + + " \"modelVersionId\":\"2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd\"" + + " }" + + " }" + + " }, {" + + " \"relatedInstance\":{" + + " \"instanceId\":\"" + vnfInstanceId + "\"," + + " \"modelInfo\":{" + + " \"modelType\":\"vnf\"," + + " \"modelName\":\"2017-488_PASQUALE-vPE\"," + + " \"modelInvariantId\":\"72e465fe-71b1-4e7b-b5ed-9496118ff7a8\"," + + " \"modelVersion\":\"5.0\"," + + " \"modelVersionId\":\"69e09f68-8b63-4cc9-b9ff-860960b5db09\"," + + " \"modelCustomizationId\":\"1da7b585-5e61-4993-b95e-8e6606c81e45\"," + + " \"modelCustomizationName\":\"2017-488_PASQUALE-vPE 0\"" + + " }" + + " }" + + " }" + + " ]," + + " \"requestParameters\":{" + + addTestApi()+ + " \"userParams\":[" + + " ]," + + " \"usePreload\":false" + + " }" + + " }" + + "}"; + } +} 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 deleted file mode 100644 index 4f662ee87..000000000 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleInstancePost.java +++ /dev/null @@ -1,62 +0,0 @@ -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/PresetMSOCreateVfModuleOldViewEdit.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleOldViewEdit.java new file mode 100644 index 000000000..bf085cae5 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleOldViewEdit.java @@ -0,0 +1,81 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVfModuleOldViewEdit extends PresetMSOBaseCreateInstancePost { + private final String serviceInstanceId; + private final String vnfInstanceId; + private final String instanceName; + + public PresetMSOCreateVfModuleOldViewEdit(String overrideRequestId, String responseInstanceId , + String serviceInstanceId, String vnfInstanceId, + String instanceName, String msoTestApi, + String cloudOwner) { + super(overrideRequestId, responseInstanceId, msoTestApi); + this.serviceInstanceId = serviceInstanceId; + this.vnfInstanceId = vnfInstanceId; + this.instanceName = instanceName; + this.cloudOwner = cloudOwner; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/"+vnfInstanceId+"/vfModules"; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"requestInfo\": {" + + " \"instanceName\": \""+instanceName+"\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"mo37915000\"" + + " }," + + " \"modelInfo\": {" + + " \"modelType\": \"vfModule\"," + + " \"modelInvariantId\": \"d9f9c851-9543-476e-b3c2-a2e5284a26aa\"," + + " \"modelVersionId\": \"d205e01d-e5da-4e68-8c52-f95cb0607959\"," + + " \"modelName\": \"Vsp1710pid298109Vmmsc..mmsc_mod1_ltm..module-8\"," + + " \"modelVersion\": \"1\"," + + " \"modelCustomizationId\": \"e81b58ce-ae9b-4bde-9f81-9962a5007756\"," + + " \"modelCustomizationName\": \"Vsp1710pid298109Vmmsc..mmsc_mod1_ltm..module-8\"" + + " }," + + " \"requestParameters\": {" + + addTestApi() + + " \"usePreload\": false" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"mdt1\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"092eb9e8e4b7412e8787dd091bc58e86\"" + + " }," + + " \"relatedInstanceList\": [{" + + " \"relatedInstance\": {" + + " \"instanceId\": \""+serviceInstanceId+"\"," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelName\": \"ServicevWINIFREDPID298109\"," + + " \"modelInvariantId\": \"a8dcd72d-d44d-44f2-aa85-53aa9ca0c657\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelVersionId\": \"aa2f8e9c-9e47-4b15-a95c-4a93855ac61b\"" + + " }" + + " }" + + " }, {" + + " \"relatedInstance\": {" + + " \"instanceId\": \""+vnfInstanceId+"\"," + + " \"modelInfo\": {" + + " \"modelType\": \"vnf\"," + + " \"modelName\": \"VSP1710PID298109_vWINIFRED\"," + + " \"modelInvariantId\": \"e7961100-cde6-4b5a-bcda-b8945086950a\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelVersionId\": \"959a7ba0-89ee-4984-9af6-65d5bdda4b0e\"," + + " \"modelCustomizationId\": \"6b8fc7dc-2db1-4283-a222-b07d10595495\"," + + " \"modelCustomizationName\": \"VSP1710PID298109_vWINIFRED 0\"" + + " }" + + " }" + + " }" + + " ]" + + " }" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.java new file mode 100644 index 000000000..c8fb7fcf9 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress.java @@ -0,0 +1,116 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress extends PresetMSOBaseCreateInstancePost { + private final String serviceInstanceId; + private final String vnfInstanceId; + private final String volumeGroupInstanceId; + private final boolean isVolumeGroupPreset; + private PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress(Boolean isVolumeGroupPreset, String requestId, String serviceInstanceId, String vnfInstanceId, String volumeGroupInstanceId, String testApi, boolean withTestApi) { + super(requestId, isVolumeGroupPreset ? volumeGroupInstanceId : DEFAULT_INSTANCE_ID, testApi, withTestApi); + this.serviceInstanceId = serviceInstanceId; + this.vnfInstanceId = vnfInstanceId; + this.isVolumeGroupPreset = isVolumeGroupPreset; + this.volumeGroupInstanceId = volumeGroupInstanceId; + } + + public static PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress forVfModule(String requestId, String serviceInstanceId, String vnfInstanceId, String volumeGroupInstanceId, String testApi, boolean withTestApi) { + return new PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress(false, requestId, serviceInstanceId, vnfInstanceId, volumeGroupInstanceId, testApi, withTestApi); + } + + public static PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress forVolumeGroup(String requestId, String serviceInstanceId, String vnfInstanceId, String testApi, boolean withTestApi) { + return new PresetMSOCreateVfModuleWithVolumeGroupALaCarteCypress(true, requestId, serviceInstanceId, vnfInstanceId, requestId,testApi, withTestApi); + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public String getReqPath() { + if (isVolumeGroupPreset) { + return getRootPath() + "/serviceInstances/v./" + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/volumeGroups"; + } else { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/vfModules"; + } + } + + @Override + public Object getRequestBody() { + return "" + + "{" + + " \"requestDetails\":{" + + " \"modelInfo\":{" + + " \"modelType\":\"" + select("volumeGroup", "vfModule") + "\"," + + " \"modelInvariantId\":\"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\"," + + " \"modelVersionId\":\"25284168-24bb-4698-8cb4-3f509146eca5\"," + + " \"modelName\":\"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\"," + + " \"modelVersion\":\"6\"," + + " \"modelCustomizationId\":\"f7e7c365-60cf-49a9-9ebf-a1aa11b9d401\"," + + " \"modelCustomizationName\":\"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\"" + + " }," + + " \"cloudConfiguration\":{" + + " \"lcpCloudRegionId\":\"my region\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"" + + " }," + + " \"requestInfo\":{" + + " \"instanceName\":\"" + select("puwesovabe_vol", "puwesovabe") + "\"," + + " \"source\":\"VID\"," + + " \"suppressRollback\":false," + + " \"requestorId\":\"us16807000\"" + + " }," + + " \"relatedInstanceList\":[{" + + " \"relatedInstance\":{" + + " \"instanceId\":\"" + serviceInstanceId + "\"," + + " \"modelInfo\":{" + + " \"modelType\":\"service\"," + + " \"modelName\":\"action-data\"," + + " \"modelInvariantId\":\"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\"," + + " \"modelVersion\":\"1.0\"," + + " \"modelVersionId\":\"2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd\"" + + " }" + + " }" + + " }, {" + + " \"relatedInstance\":{" + + " \"instanceId\":\"" + vnfInstanceId + "\"," + + " \"modelInfo\":{" + + " \"modelType\":\"vnf\"," + + " \"modelName\":\"2017-488_PASQUALE-vPE\"," + + " \"modelInvariantId\":\"72e465fe-71b1-4e7b-b5ed-9496118ff7a8\"," + + " \"modelVersion\":\"5.0\"," + + " \"modelVersionId\":\"69e09f68-8b63-4cc9-b9ff-860960b5db09\"," + + " \"modelCustomizationId\":\"1da7b585-5e61-4993-b95e-8e6606c81e45\"," + + " \"modelCustomizationName\":\"2017-488_PASQUALE-vPE 0\"" + + " }" + + " }" + + select("", " }, {" + + " \"relatedInstance\":{" + + " \"modelInfo\":{" + + " \"modelType\":\"volumeGroup\"" + + " }," + + " \"instanceId\":\"" + volumeGroupInstanceId + "\"," + + " \"instanceName\":\"puwesovabe_vol\"" + + " } ") + + " }" + + " ]," + + " \"requestParameters\":{" + + addTestApi()+ + " \"userParams\":[{" + + " \"2017488_PASQUALEvpe0_vnf_instance_name\":\"mtnj309me6\"," + + " \"2017488_PASQUALEvpe0_vnf_config_template_version\":\"17.2\"," + + " \"PASQUALEvpe0_bandwidth\":\"10\"," + + " \"2017488_PASQUALEvpe0_AIC_CLLI\":\"ATLMY8GA\"," + + " \"PASQUALEvpe0_bandwidth_units\":\"Gbps\"" + + " }" + + " ]," + + " \"usePreload\":true" + + " }" + + " }" + + "}"; + } + + private String select(String ofVolumeGroup, String ofVfModule) { + return isVolumeGroupPreset ? ofVolumeGroup : ofVfModule; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteCypress2.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteCypress2.java new file mode 100644 index 000000000..96424e803 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteCypress2.java @@ -0,0 +1,51 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVnfALaCarteCypress2 extends PresetMSOCreateVnfBase { + private String vnfInstanceName; + + public PresetMSOCreateVnfALaCarteCypress2(String overrideRequestId, String serviceInstanceId, String responseInstanceId, String vnfInstanceName, String testApi, boolean withTestApi) { + super(overrideRequestId, serviceInstanceId, responseInstanceId); + this.vnfInstanceName = vnfInstanceName; + this.msoTestApi = testApi; + this.withTestApi = withTestApi; + } + + @Override + public Object getRequestBody() { + return "{\"requestDetails\":" + + "{\"requestInfo\":" + + "{\"instanceName\":\""+vnfInstanceName+"\"," + + "\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"," + + "\"source\":\"VID\"," + + "\"suppressRollback\":false," + + "\"requestorId\":\"us16807000\"}," + + "\"lineOfBusiness\":{\"lineOfBusinessName\":\"zzz1\"}," + + "\"cloudConfiguration\":" + + "{\"lcpCloudRegionId\":\"just another region\"," + + addCloudOwnerIfNeeded() + + "\"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"}," + + "\"platform\":{\"platformName\":\"xxx1\"}," + + "\"modelInfo\":" + + "{\"modelCustomizationId\":\"1da7b585-5e61-4993-b95e-8e6606c81e45\"," + + "\"modelCustomizationName\":\"2017-488_PASQUALE-vPE 0\"," + + "\"modelVersionId\":\"69e09f68-8b63-4cc9-b9ff-860960b5db09\"," + + "\"modelName\":\"2017-488_PASQUALE-vPE\"," + + "\"modelInvariantId\":\"72e465fe-71b1-4e7b-b5ed-9496118ff7a8\"," + + "\"modelType\":\"vnf\"," + + "\"modelVersion\":\"5.0\"}," + + "\"requestParameters\":{" + + addTestApi()+ + "\"userParams\":[]}, " + + "\"relatedInstanceList\":[" + + "{\"relatedInstance\":{" + + "\"instanceId\":\""+serviceInstanceId+"\"," + + "\"modelInfo\":{" + + "\"modelVersionId\":\"2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd\"," + + "\"modelName\":\"action-data\"," + + "\"modelInvariantId\":\"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\"," + + "\"modelType\":\"service\"," + + "\"modelVersion\":\"1.0\"" + + "}}}]" + + "}}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteOldViewEdit.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteOldViewEdit.java new file mode 100644 index 000000000..7947c5b83 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteOldViewEdit.java @@ -0,0 +1,69 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVnfALaCarteOldViewEdit extends PresetMSOCreateVnfBase { + private String vnfInstanceName; + private boolean haveLOB; + + public PresetMSOCreateVnfALaCarteOldViewEdit(String overrideRequestId, String serviceInstanceId, + String vnfInstanceName, boolean haveLOB, String msoTestApi) { + super(overrideRequestId, serviceInstanceId); + this.vnfInstanceName = vnfInstanceName; + this.haveLOB = haveLOB; + this.msoTestApi = msoTestApi; + this.withTestApi = true; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"requestInfo\": {" + + " \"instanceName\": \""+vnfInstanceName+"\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"mo37915000\"," + + " \"productFamilyId\": \"ebc3bc3d-62fd-4a3f-a037-f619df4ff034\"" + + " }," + + " \"modelInfo\": {" + + " \"modelType\": \"vnf\"," + + " \"modelInvariantId\": \"e7961100-cde6-4b5a-bcda-b8945086950a\"," + + " \"modelVersionId\": \"959a7ba0-89ee-4984-9af6-65d5bdda4b0e\"," + + " \"modelName\": \"VSP1710PID298109_vWINIFRED\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelCustomizationId\": \"6b8fc7dc-2db1-4283-a222-b07d10595495\"," + + " \"modelCustomizationName\": \"VSP1710PID298109_vWINIFRED 0\"" + + " }," + + " \"requestParameters\": {" + + addTestApi() + + " \"userParams\": []" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"some legacy region\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"092eb9e8e4b7412e8787dd091bc58e86\"" + + " }," + + selectLob("\"lineOfBusiness\": {\"lineOfBusinessName\": \"ECOMP\"},", "") + + " \"platform\": {" + + " \"platformName\": \"platform\"" + + " }," + + " \"relatedInstanceList\": [{" + + " \"relatedInstance\": {" + + " \"instanceId\": \""+serviceInstanceId+"\"," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelName\": \"ServicevWINIFREDPID298109\"," + + " \"modelInvariantId\": \"a8dcd72d-d44d-44f2-aa85-53aa9ca0c657\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelVersionId\": \"aa2f8e9c-9e47-4b15-a95c-4a93855ac61b\"" + + " }" + + " }" + + " }" + + " ]" + + " }"+ + "}"; + } + + private String selectLob(String lob, String noLob) { + return haveLOB ? lob : noLob; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteServiceCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteServiceCypress.java new file mode 100644 index 000000000..2be8c639b --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteServiceCypress.java @@ -0,0 +1,51 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVnfALaCarteServiceCypress extends PresetMSOCreateVnfBase { + protected String vnfInstanceName; + protected String lineOfBusinessName; + + public PresetMSOCreateVnfALaCarteServiceCypress(String overrideRequestId, String serviceInstanceId, String vnfInstanceName, String lineOfBusinessName) { + super(overrideRequestId, serviceInstanceId); + this.vnfInstanceName = vnfInstanceName; + this.lineOfBusinessName = lineOfBusinessName; + } + + @Override + public Object getRequestBody() { + return "{\"requestDetails\":" + + "{\"requestInfo\":" + + "{\"instanceName\":\""+vnfInstanceName+"\"," + + "\"productFamilyId\":\"36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e\"," + + "\"source\":\"VID\"," + + "\"suppressRollback\":false," + + "\"requestorId\":\"us16807000\"}," + + "\"lineOfBusiness\":{\"lineOfBusinessName\":\""+lineOfBusinessName+"\"}," + + "\"cloudConfiguration\":" + + "{\"lcpCloudRegionId\":\"hvf6\"," + + addCloudOwnerIfNeeded() + + "\"tenantId\":\"bae71557c5bb4d5aac6743a4e5f1d054\"}," + + "\"platform\":{\"platformName\":\"platform\"}," + + "\"modelInfo\":" + + "{\"modelCustomizationId\":\"91415b44-753d-494c-926a-456a9172bbb9\"," + + "\"modelCustomizationName\":\"VF_vGeraldine 0\"," + + "\"modelVersionId\":\"d6557200-ecf2-4641-8094-5393ae3aae60\"," + + "\"modelName\":\"VF_vGeraldine\"," + + "\"modelInvariantId\":\"4160458e-f648-4b30-a176-43881ffffe9e\"," + + "\"modelType\":\"vnf\"," + + "\"modelVersion\":\"2.0\"}," + + "\"requestParameters\":{" + + "\"testApi\": \"GR_API\", " + + "\"userParams\":[]" + + "}," + + "\"relatedInstanceList\":[" + + "{\"relatedInstance\":{" + + "\"instanceId\":\"f8791436-8d55-4fde-b4d5-72dd2cf13cfb\"," + + "\"modelInfo\":{" + + "\"modelVersionId\":\"6e59c5de-f052-46fa-aa7e-2fca9d674c44\"," + + "\"modelName\":\"ComplexService\"," + + "\"modelInvariantId\":\"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\"," + + "\"modelType\":\"service\"," + + "\"modelVersion\":\"1.0\"" + + "}}}]}}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteServiceCypress2.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteServiceCypress2.java new file mode 100644 index 000000000..afdb3f49b --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteServiceCypress2.java @@ -0,0 +1,47 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVnfALaCarteServiceCypress2 extends PresetMSOCreateVnfALaCarteServiceCypress { + + public PresetMSOCreateVnfALaCarteServiceCypress2(String overrideRequestId, String serviceInstanceId, String vnfInstanceName, String lineOfBusinessName) { + super(overrideRequestId, serviceInstanceId, vnfInstanceName, lineOfBusinessName); + } + + @Override + public Object getRequestBody() { + return "{\"requestDetails\":" + + "{\"requestInfo\":" + + "{\"instanceName\":\""+vnfInstanceName+"\"," + + "\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"," + + "\"source\":\"VID\"," + + "\"suppressRollback\":false," + + "\"requestorId\":\"us16807000\"}," + + "\"lineOfBusiness\":{\"lineOfBusinessName\":\""+lineOfBusinessName+"\"}," + + "\"cloudConfiguration\":" + + "{\"lcpCloudRegionId\":\"hvf6\"," + + addCloudOwnerIfNeeded() + + "\"tenantId\":\"229bcdc6eaeb4ca59d55221141d01f8e\"}," + + "\"platform\":{\"platformName\":\"xxx1\"}," + + "\"modelInfo\":" + + "{\"modelCustomizationId\":\"b3c76f73-eeb5-4fb6-9d31-72a889f1811c\"," + + "\"modelCustomizationName\":\"2017-388_PASQUALE-vPE 0\"," + + "\"modelVersionId\":\"afacccf6-397d-45d6-b5ae-94c39734b168\"," + + "\"modelName\":\"2017-388_PASQUALE-vPE\"," + + "\"modelInvariantId\":\"72e465fe-71b1-4e7b-b5ed-9496118ff7a8\"," + + "\"modelType\":\"vnf\"," + + "\"modelVersion\":\"4.0\"}," + + "\"requestParameters\":{" + + "\"testApi\": \"VNF_API\", " + + "\"userParams\":[]" + + "}," + + "\"relatedInstanceList\":[" + + "{\"relatedInstance\":{" + + "\"instanceId\":\"f8791436-8d55-4fde-b4d5-72dd2cf13cfb\"," + + "\"modelInfo\":{" + + "\"modelVersionId\":\"6b528779-44a3-4472-bdff-9cd15ec93450\"," + + "\"modelName\":\"action-data\"," + + "\"modelInvariantId\":\"e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0\"," + + "\"modelType\":\"service\"," + + "\"modelVersion\":\"1.0\"" + + "}}}]}}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfBase.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfBase.java new file mode 100644 index 000000000..0fcbb3fe0 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfBase.java @@ -0,0 +1,25 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVnfBase extends PresetMSOBaseCreateInstancePost { + protected String serviceInstanceId; + + public PresetMSOCreateVnfBase(String requestId, String serviceInstanceId) { + super(requestId); + this.serviceInstanceId = serviceInstanceId; + } + + public PresetMSOCreateVnfBase(String requestId, String serviceInstanceId, String responseInstanceId) { + super(requestId, responseInstanceId); + this.serviceInstanceId = serviceInstanceId; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfGroup.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfGroup.java new file mode 100644 index 000000000..ac2d6f4b9 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfGroup.java @@ -0,0 +1,68 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVnfGroup extends PresetMSOBaseCreateInstancePost { + private String serviceInstanceId; + private String modelInfo; + private String instanceName; + private boolean suppressRollback; + + public PresetMSOCreateVnfGroup(String instanceName, String vnfGroupRequestId, String groupModelInfo, String serviceInstanceId,boolean suppressRollback ) { + super(vnfGroupRequestId); + this.serviceInstanceId = serviceInstanceId; + this.modelInfo = groupModelInfo; + this.instanceName = instanceName; + this.suppressRollback = suppressRollback; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./instanceGroups"; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + modelInfo + + " \"requestInfo\": {" + + " \"instanceName\": \"" + instanceName + "\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": "+suppressRollback+"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"relatedInstanceList\": [" + + " {" + + " \"relatedInstance\": {" + + " \"instanceId\": \"" + serviceInstanceId + "\"," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelInvariantId\": \"7ee41ce4-4827-44b0-a48e-2707a59905d2\"," + + " \"modelVersionId\": \"4117a0b6-e234-467d-b5b9-fe2f68c8b0fc\"," + + " \"modelName\": \"Grouping Service for Test\"," + + " \"modelVersion\": \"1.0\"" + + " }" + + " }" + + " }" + + " ]," + + " \"requestParameters\": {" + + " \"testApi\": \"VNF_API\", " + + " \"userParams\": []" + + " }" + + " }" + + "}"; + } + + //only modelType and modelVersionId are required by MSO fro create instance group + public static final String MODEL_INFO_0 = "" + + " \"modelInfo\": {" + + " \"modelType\": \"instanceGroup\"," + + " \"modelVersionId\": \"daeb6568-cef8-417f-9075-ed259ce59f48\"" + + " },"; + + public static final String MODEL_INFO_1 = "" + + " \"modelInfo\": {" + + " \"modelType\": \"instanceGroup\"," + + " \"modelVersionId\": \"c2b300e6-45de-4e5e-abda-3032bee2de56\"" + + " },"; + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfVlanTagging.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfVlanTagging.java new file mode 100644 index 000000000..9fd0a678f --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfVlanTagging.java @@ -0,0 +1,94 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVnfVlanTagging extends PresetMSOBaseCreateInstancePost { + private final boolean ecompNamingEnabled; + private String serviceInstanceId; + private String serviceModelVersionId; + + public PresetMSOCreateVnfVlanTagging(String serviceInstanceId, String serviceModelVersionId, boolean ecompNamingEnabled) { + this.serviceInstanceId = serviceInstanceId; + this.serviceModelVersionId = serviceModelVersionId; + this.ecompNamingEnabled = ecompNamingEnabled; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs"; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"requestInfo\": {" + + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"instanceName\" : \"NewName\"," + +// addInstanceNameIfNeeded()+ + " \"requestorId\": \"us16807000\"" + + " }," + + " \"lineOfBusiness\": {" + + " \"lineOfBusinessName\": \"ECOMP\"" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"JANET25\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"092eb9e8e4b7412e8787dd091bc58e86\"" + + " }," + + " \"platform\": {" + + " \"platformName\": \"xxx1\"" + + " }," + + " \"modelInfo\": {" + + " \"modelCustomizationId\": \"882e5dcb-ba9f-4766-8cde-e326638107db\"," + + " \"modelCustomizationName\": \"vDOROTHEA 0\"," + + " \"modelVersionId\": \"61535073-2e50-4141-9000-f66fea69b433\"," + + " \"modelName\": \"vDOROTHEA\"," + + " \"modelInvariantId\": \"fcdf49ce-6f0b-4ca2-b676-a484e650e734\"," + + " \"modelType\": \"vnf\"," + + " \"modelVersion\": \"0.2\"" + + " }," + + " \"requestParameters\": {" + + " \"userParams\": []," + + " \"testApi\": \"VNF_API\"" + + " }," + + " \"relatedInstanceList\": [{" + + " \"relatedInstance\": {" + + " \"instanceId\": \""+ serviceInstanceId +"\"," + + " \"modelInfo\": {" + + " \"modelVersionId\": \""+ serviceModelVersionId +"\"," + + " \"modelName\": \"vDOROTHEA_srv\"," + + " \"modelInvariantId\": \"9aa04749-c02c-432d-a90c-18caa361c833\"," + + " \"modelType\": \"service\"," + + " \"modelVersion\": \"1.0\"" + + " }" + + " }" + + " }, {" + + " \"relatedInstance\": {" + + " \"instanceId\": \"AAI-12002-test3-vm230w\"," + + " \"modelInfo\": {" + + " \"modelType\": \"networkInstanceGroup\"" + + " }" + + " }" + + " }, {" + + " \"relatedInstance\": {" + + " \"instanceId\": \"AAI-12002-test3-vm230w\"," + + " \"modelInfo\": {" + + " \"modelType\": \"networkInstanceGroup\"" + + " }" + + " }" + + " }" + + " ]" + + " }" + + "}"; + } + + private String addInstanceNameIfNeeded() { + return ecompNamingEnabled ? "": "\"instanceName\" : \"NewName\","; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVolumeGroupOldViewEdit.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVolumeGroupOldViewEdit.java new file mode 100644 index 000000000..ed5bee788 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVolumeGroupOldViewEdit.java @@ -0,0 +1,78 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOCreateVolumeGroupOldViewEdit extends PresetMSOBaseCreateInstancePost { + private final String serviceInstanceId; + private final String vnfInstanceId; + private final String instanceName; + + public PresetMSOCreateVolumeGroupOldViewEdit(String overrideRequestId, String responseInstanceId , + String serviceInstanceId, String vnfInstanceId, + String instanceName, String msoTestApi) { + super(overrideRequestId, responseInstanceId, msoTestApi); + this.serviceInstanceId = serviceInstanceId; + this.vnfInstanceId = vnfInstanceId; + this.instanceName = instanceName; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstances/v./" + serviceInstanceId + "/vnfs/"+vnfInstanceId+"/volumeGroups"; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"requestInfo\": {" + + " \"instanceName\": \""+instanceName+"\"," + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"mo37915000\"" + + " }," + + " \"modelInfo\": {" + + " \"modelType\": \"volumeGroup\"," + + " \"modelInvariantId\": \"6931e88a-fbcc-4ca9-8583-876b669c3106\"," + + " \"modelVersionId\": \"13f022c4-651e-4326-b8e1-61e9a8c7a7ad\"," + + " \"modelName\": \"Vsp1710pid298109Vmmsc..mmsc_mod6_eca_oam..module-3\"," + + " \"modelVersion\": \"1\"," + + " \"modelCustomizationId\": \"020af091-cc66-46db-876c-02f14b4a795f\"," + + " \"modelCustomizationName\": \"Vsp1710pid298109Vmmsc..mmsc_mod6_eca_oam..module-3\"" + + " }," + + " \"requestParameters\": {" + + addTestApi() + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"some legacy region\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"092eb9e8e4b7412e8787dd091bc58e86\"" + + " }," + + " \"relatedInstanceList\": [{" + + " \"relatedInstance\": {" + + " \"instanceId\": \""+serviceInstanceId+"\"," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelName\": \"ServicevWINIFREDPID298109\"," + + " \"modelInvariantId\": \"a8dcd72d-d44d-44f2-aa85-53aa9ca0c657\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelVersionId\": \"aa2f8e9c-9e47-4b15-a95c-4a93855ac61b\"" + + " }" + + " }" + + " }, {" + + " \"relatedInstance\": {" + + " \"instanceId\": \""+vnfInstanceId+"\"," + + " \"modelInfo\": {" + + " \"modelType\": \"vnf\"," + + " \"modelName\": \"VSP1710PID298109_vWINIFRED\"," + + " \"modelInvariantId\": \"e7961100-cde6-4b5a-bcda-b8945086950a\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelVersionId\": \"959a7ba0-89ee-4984-9af6-65d5bdda4b0e\"," + + " \"modelCustomizationId\": \"6b8fc7dc-2db1-4283-a222-b07d10595495\"," + + " \"modelCustomizationName\": \"VSP1710PID298109_vWINIFRED 0\"" + + " }" + + " }" + + " }" + + " ]" + + " }" + + "}"; + } +} 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; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDeleteErrorResponse.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDeleteErrorResponse.java new file mode 100644 index 000000000..fc19aed9d --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeactivateAndCloudDeleteErrorResponse.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 PresetMSODeactivateAndCloudDeleteErrorResponse extends BaseMSOPreset { + private final String serviceInstanceId; + private final String vnfInstanceId; + private final String vfModuleInstanceId; + private final int errorCode; + 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 PresetMSODeactivateAndCloudDeleteErrorResponse(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId, int errorCode, String cloudOwner) { + this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; + this.vnfInstanceId = vnfInstanceId; + this.vfModuleInstanceId = vfModuleInstanceId; + this.errorCode = errorCode > 0 ? errorCode : 500; + 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 "{\"error\":\"222\",\"message\":\"error message\"}"; + } + + @Override + public int getResponseCode() { + return errorCode; + } + + @Override + public boolean isStrictMatch() { + return true; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteALaCarteService.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteALaCarteService.java new file mode 100644 index 000000000..b20d462e6 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteALaCarteService.java @@ -0,0 +1,58 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.springframework.http.HttpMethod; + +public class PresetMSODeleteALaCarteService extends PresetMSODeleteService { + + private final int responseCode; + + public PresetMSODeleteALaCarteService(String requestId, String serviceInstanceId) { + super(requestId, serviceInstanceId); + responseCode = 202; + } + + public PresetMSODeleteALaCarteService(String requestId, String serviceInstanceId, int responseCode) { + super(requestId, serviceInstanceId); + this.responseCode = responseCode; + } + + @Override + public int getResponseCode() { + return responseCode; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelInvariantId\": \"7ee41ce4-4827-44b0-a48e-2707a59905d2\"," + + " \"modelVersionId\": \"4117a0b6-e234-467d-b5b9-fe2f68c8b0fc\"," + + " \"modelName\": \"Grouping Service for Test\"," + + " \"modelType\": \"service\"," + + " \"modelVersion\": \"1.0\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"requestParameters\": {" + + " \"testApi\": \"VNF_API\","+ + " \"aLaCarte\": true" + + " }" + + " }" + + "}"; + + } + + @Override + protected String getRootPath() { + return "/mso/serviceInstantiation/v./serviceInstances/"; + + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.DELETE; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteBaseVfModuleCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteBaseVfModuleCypress.java new file mode 100644 index 000000000..fc9cc3c5c --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteBaseVfModuleCypress.java @@ -0,0 +1,38 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSODeleteBaseVfModuleCypress extends PresetMSODeleteVfModule { + + public PresetMSODeleteBaseVfModuleCypress() { + super(null, null, null, null); + } + + public PresetMSODeleteBaseVfModuleCypress(String requestId, String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId) { + super(requestId, serviceInstanceId, vnfInstanceId, vfModuleInstanceId); + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\":{" + + " \"modelInfo\":{" + + " \"modelCustomizationName\":\"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\"," + + " \"modelCustomizationId\":\"a55961b2-2065-4ab0-a5b7-2fcee1c227e3\"," + + " \"modelInvariantId\":\"b34833bb-6aa9-4ad6-a831-70b06367a091\"," + + " \"modelVersionId\":\"f8360508-3f17-4414-a2ed-6bc71161e8db\"," + + " \"modelName\":\"2017488PASQUALEVpe..PASQUALE_base_vPE_BV..module-0\"," + + " \"modelType\":\"vfModule\"," + + " \"modelVersion\":\"5\"" + + " }," + + " \"cloudConfiguration\":{" + + " \"lcpCloudRegionId\":\"JANET25\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"," + + " }," + + " \"requestInfo\":{" + + " \"source\":\"VID\"," + + " \"requestorId\":\"us16807000\"" + + " }" + + " }" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteGroupMembers.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteGroupMembers.java new file mode 100644 index 000000000..670e9a5e8 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteGroupMembers.java @@ -0,0 +1,51 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import com.google.common.collect.ImmutableList; +import org.springframework.http.HttpMethod; + +import static java.util.stream.Collectors.joining; + +public class PresetMSODeleteGroupMembers extends PresetMSOBaseCreateInstancePost { + + + private final ImmutableList groupMembersInstanceIds; + + public PresetMSODeleteGroupMembers(String vnfGroupInstanceId, ImmutableList groupMembersInstanceIds, String requestId) { + super(requestId, vnfGroupInstanceId); + this.groupMembersInstanceIds = groupMembersInstanceIds; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./instanceGroups/" + responseInstanceId + "/removeMembers"; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"relatedInstanceList\": [" + + groupMembersInstanceIds.stream().map(groupMemberInstanceId -> + " { " + + " \"relatedInstance\": { " + + " \"instanceId\": \""+ groupMemberInstanceId +"\"," + + " \"modelInfo\": {" + + " \"modelType\": \"vnf\"" + + " }" + + " }" + + " }").collect(joining(", ")) + + " ]" + + " }" + + "}" ; + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceGroup.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceGroup.java new file mode 100644 index 000000000..9174cd2bb --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceGroup.java @@ -0,0 +1,28 @@ +package org.onap.simulator.presetGenerator.presets.mso; + + +import java.util.Map; + +public class PresetMSODeleteInstanceGroup extends PresetMSOBaseDelete { + + private final String userId; + + public PresetMSODeleteInstanceGroup(String requestId, String instanceId, String userId) { + super(requestId, instanceId); + this.userId = userId; + } + + @Override + public String getReqPath() { + return "/mso/serviceInstantiation/v./instanceGroups/"+instanceId; + } + + @Override + public Map getRequestHeaders() { + Map map = super.getRequestHeaders(); + map.put("X-RequestorID", userId); + return map; + + } + +} 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 index bfe3a24c5..3d6770518 100644 --- 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 @@ -30,7 +30,7 @@ public class PresetMSODeleteInstanceOrchestrationRequestGet extends BaseMSOPrese } public String getReqPath() { - return getRootPath() + "/orchestrationRequests/v5/" + requestId; + return getRootPath() + "/orchestrationRequests/v./" + requestId; } @Override 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 index 426dec3d9..f45569448 100644 --- 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 @@ -1,6 +1,6 @@ package org.onap.simulator.presetGenerator.presets.mso; -public class PresetMSODeleteNetwork extends PresetMSOBaseDelete { +public class PresetMSODeleteNetwork extends PresetMSOBaseDeleteWithCloudConfiguration { private final String serviceInstanceId; private final String networkInstanceId; public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; @@ -11,13 +11,13 @@ public class PresetMSODeleteNetwork extends PresetMSOBaseDelete { } public PresetMSODeleteNetwork(String requestId, String serviceInstanceId, String networkInstanceId) { - super(requestId); + super(requestId, "network"); 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; + return "/mso/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/networks/" + networkInstanceId; } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteNetworkAlaCarteCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteNetworkAlaCarteCypress.java new file mode 100644 index 000000000..23710f19a --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteNetworkAlaCarteCypress.java @@ -0,0 +1,56 @@ +package org.onap.simulator.presetGenerator.presets.mso; + + +public class PresetMSODeleteNetworkAlaCarteCypress extends PresetMSOBaseDelete { + + private final String userId; + private final String serviceInstanceId; + private final String networkInstanceId; + + public PresetMSODeleteNetworkAlaCarteCypress(String requestId, String serviceInstanceId, String networkInstanceId, String userId) { + super(requestId, networkInstanceId); + this.userId = userId; + this.serviceInstanceId = serviceInstanceId; + this.networkInstanceId = networkInstanceId; + } + + @Override + public String getReqPath() { + return "/mso/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/networks/" + networkInstanceId; + } +// +// @Override +// public Map getRequestHeaders() { +// Map map = super.getRequestHeaders(); +// map.put("X-RequestorID", userId); +// return map; +// +// } + + @Override + public String getRequestBody() { + return "{" + + " \"requestDetails\":{" + + " \"modelInfo\":{" + + " \"modelInvariantId\":\"379f816b-a7aa-422f-be30-17114ff50b7c\",\n" + + " \"modelVersionId\":\"ddc3f20c-08b5-40fd-af72-c6d14636b986\",\n" + + " \"modelName\":\"ExtVL\",\n" + + " \"modelVersion\":\"37.0\",\n" + + " \"modelType\":\"network\",\n" + + " \"modelCustomizationId\":\"94fdd893-4a36-4d70-b16a-ec29c54c184f\",\n" + + " \"modelCustomizationName\":\"ExtVL 0\"" + + " }," + + " \"cloudConfiguration\":{" + + " \"lcpCloudRegionId\":\"hvf6\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\":\"229bcdc6eaeb4ca59d55221141d01f8e\"" + + " }," + + " \"requestInfo\":{" + + " \"source\":\"VID\"," + + " \"requestorId\":\"" + userId + "\"" + + " }" + + " }" + + "}"; + } + +} 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 index 76487edf5..85ee1a8be 100644 --- 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 @@ -1,6 +1,6 @@ package org.onap.simulator.presetGenerator.presets.mso; -public class PresetMSODeleteVfModule extends PresetMSOBaseDelete { +public class PresetMSODeleteVfModule extends PresetMSOBaseDeleteWithCloudConfiguration { private final String serviceInstanceId; private final String vnfInstanceId; private final String vfModuleInstanceId; @@ -13,7 +13,7 @@ public class PresetMSODeleteVfModule extends PresetMSOBaseDelete { } public PresetMSODeleteVfModule(String requestId, String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId) { - super(requestId); + super(requestId, "vfModule"); 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; diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModuleCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModuleCypress.java new file mode 100644 index 000000000..d4a21cc36 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVfModuleCypress.java @@ -0,0 +1,38 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSODeleteVfModuleCypress extends PresetMSODeleteVfModule { + + public PresetMSODeleteVfModuleCypress() { + super(null, null, null, null); + } + + public PresetMSODeleteVfModuleCypress(String requestId, String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId) { + super(requestId, serviceInstanceId, vnfInstanceId, vfModuleInstanceId); + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\":{" + + " \"modelInfo\":{" + + " \"modelCustomizationName\":\"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\"," + + " \"modelCustomizationId\":\"f7e7c365-60cf-49a9-9ebf-a1aa11b9d401\"," + + " \"modelInvariantId\":\"7253ff5c-97f0-4b8b-937c-77aeb4d79aa1\"," + + " \"modelVersionId\":\"25284168-24bb-4698-8cb4-3f509146eca5\"," + + " \"modelName\":\"2017488PASQUALEVpe..PASQUALE_vRE_BV..module-1\"," + + " \"modelType\":\"vfModule\"," + + " \"modelVersion\":\"6\"" + + " }," + + " \"cloudConfiguration\":{" + + " \"lcpCloudRegionId\":\"JANET25\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"," + + " }," + + " \"requestInfo\":{" + + " \"source\":\"VID\"," + + " \"requestorId\":\"us16807000\"" + + " }" + + " }" + + "}"; + } +} 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 index 83c9883f8..f1142523d 100644 --- 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 @@ -1,6 +1,6 @@ package org.onap.simulator.presetGenerator.presets.mso; -public class PresetMSODeleteVnf extends PresetMSOBaseDelete { +public class PresetMSODeleteVnf extends PresetMSOBaseDeleteWithCloudConfiguration { private final String serviceInstanceId; private final String vnfInstanceId; public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; @@ -11,7 +11,7 @@ public class PresetMSODeleteVnf extends PresetMSOBaseDelete { } public PresetMSODeleteVnf(String requestId, String serviceInstanceId, String vnfInstanceId) { - super(requestId); + super(requestId, "vnf"); this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; this.vnfInstanceId = vnfInstanceId != null ? vnfInstanceId : DEFAULT_VNF_INSTANCE_ID; } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVnfAlaCarteCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVnfAlaCarteCypress.java new file mode 100644 index 000000000..bb33bbe2a --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSODeleteVnfAlaCarteCypress.java @@ -0,0 +1,48 @@ +package org.onap.simulator.presetGenerator.presets.mso; + + +public class PresetMSODeleteVnfAlaCarteCypress extends PresetMSOBaseDelete { + + private final String userId; + private final String serviceInstanceId; + private final String vnfInstanceId; + + public PresetMSODeleteVnfAlaCarteCypress(String requestId, String serviceInstanceId, String vnfInstanceId, String userId) { + super(requestId, vnfInstanceId); + this.userId = userId; + this.serviceInstanceId = serviceInstanceId; + this.vnfInstanceId = vnfInstanceId; + } + + @Override + public String getReqPath() { + return "/mso/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/" + vnfInstanceId; + } + + @Override + public String getRequestBody() { + return "{" + + " \"requestDetails\":{" + + " \"modelInfo\":{" + + " \"modelInvariantId\":\"72e465fe-71b1-4e7b-b5ed-9496118ff7a8\",\n" + + " \"modelVersionId\":\"69e09f68-8b63-4cc9-b9ff-860960b5db09\",\n" + + " \"modelName\":\"2017-488_PASQUALE-vPE\",\n" + + " \"modelVersion\":\"5.0\",\n" + + " \"modelType\":\"vnf\",\n" + + " \"modelCustomizationId\":\"1da7b585-5e61-4993-b95e-8e6606c81e45\",\n" + + " \"modelCustomizationName\":\"2017-488_PASQUALE-vPE 0\"" + + " }," + + " \"cloudConfiguration\":{" + + " \"lcpCloudRegionId\":\"some legacy region\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\":\"092eb9e8e4b7412e8787dd091bc58e86\"" + + " }," + + " \"requestInfo\":{" + + " \"source\":\"VID\"," + + " \"requestorId\":\"" + userId + "\"" + + " }" + + " }" + + "}"; + } + +} 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 index d9598b20d..964d37e84 100644 --- 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 @@ -1,6 +1,6 @@ package org.onap.simulator.presetGenerator.presets.mso; -public class PresetMSODeleteVolumeGroup extends PresetMSOBaseDelete { +public class PresetMSODeleteVolumeGroup extends PresetMSOBaseDeleteWithCloudConfiguration { private final String serviceInstanceId; private final String vnfInstanceId; private final String volumeGroupInstanceId; @@ -13,7 +13,7 @@ public class PresetMSODeleteVolumeGroup extends PresetMSOBaseDelete { } public PresetMSODeleteVolumeGroup(String requestId, String serviceInstanceId, String vnfInstanceId, String volumeGroupInstanceId) { - super(requestId); + super(requestId, "volumeGroup"); 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; @@ -23,4 +23,10 @@ public class PresetMSODeleteVolumeGroup extends PresetMSOBaseDelete { public String getReqPath() { return getRootPath() + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/volumeGroups/" + volumeGroupInstanceId; } + + //remove this method once VfModule path starts with /serviceInstantiation/v7/ + @Override + protected String getRootPath() { + return "/mso/serviceInstances/v7/"; + } } 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 index dcf1a054d..381ac856b 100644 --- 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 @@ -1,21 +1,35 @@ package org.onap.simulator.presetGenerator.presets.mso; import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; import org.springframework.http.HttpMethod; +import java.time.Instant; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; + /** * Created by itzikliderman on 13/12/2017. */ public class PresetMSOOrchestrationRequestGet extends BaseMSOPreset { + private static final Logger logger = LogManager.getLogger(PresetMSOOrchestrationRequestGet.class); + + public static final String COMPLETE = "COMPLETE"; + public static final String DEFAULT_REQUEST_ID = "c0011670-0e1a-4b74-945d-8bf5aede1d9c"; + public static final String DEFAULT_SERVICE_INSTANCE_ID = BaseMSOPreset.DEFAULT_INSTANCE_ID; - private final String DEFAULT_REQUEST_ID = "c0011670-0e1a-4b74-945d-8bf5aede1d9c"; private final String requestId; private String statusMessage; - String requestState; + private String requestState; + private int startedHoursAgo = 1; + public PresetMSOOrchestrationRequestGet() { - requestState = "COMPLETE"; + requestState = COMPLETE; this.requestId = DEFAULT_REQUEST_ID; } @@ -35,25 +49,38 @@ public class PresetMSOOrchestrationRequestGet extends BaseMSOPreset { this.statusMessage = statusMessage; } + public PresetMSOOrchestrationRequestGet(String requestState, String overrideRequestId, String statusMessage, int startedHoursAgo) { + this.requestState = requestState; + this.requestId = overrideRequestId; + this.statusMessage = statusMessage; + this.startedHoursAgo = startedHoursAgo; + } + + public PresetMSOOrchestrationRequestGet(String requestState, int startedHoursAgo) { + this.requestState = requestState; + this.requestId = DEFAULT_REQUEST_ID; + this.startedHoursAgo = startedHoursAgo; + } + @Override public HttpMethod getReqMethod() { return HttpMethod.GET; } public String getReqPath() { - return getRootPath() + "/orchestrationRequests/v5/" + requestId; + return getRootPath() + "/orchestrationRequests/v./" + requestId; } @Override public Object getResponseBody() { - return "{" + + String body = "{" + " \"request\": {" + " \"requestId\": \"" + requestId + "\"," + - " \"startTime\": \"Mon, 11 Dec 2017 07:27:49 GMT\"," + + " \"startTime\": \"" + getTimeHoursAgo(startedHoursAgo) + "\"," + " \"requestScope\": \"service\"," + " \"requestType\": \"createInstance\"," + " \"instanceReferences\": {" + - " \"serviceInstanceId\": \"f8791436-8d55-4fde-b4d5-72dd2cf13cfb\"," + + " \"serviceInstanceId\": \"" + DEFAULT_SERVICE_INSTANCE_ID + "\"," + " \"serviceInstanceName\": \"asdfasdf234234asdf\"," + " \"requestorId\": \"il883e\"" + " }," + @@ -61,17 +88,30 @@ public class PresetMSOOrchestrationRequestGet extends BaseMSOPreset { " \"requestState\": \"" + requestState + "\"," + " \"statusMessage\": \"" + getStatusMessage() + "\"," + " \"percentProgress\": 100," + - " \"finishTime\": \"Mon, 11 Dec 2017 07:27:53 GMT\"" + + " \"timestamp\": \"" + getTimeNow() + "\"" + " }" + " }" + "}"; + logger.info(body); + return body; } private String getStatusMessage() { - if (!StringUtils.isEmpty(statusMessage)) - return statusMessage; - return "COMPLETE".equals(requestState) ? - "Service Instance was created successfully." : - ("Service Instance was " + requestState.toLowerCase() + " successfully."); + return StringUtils.defaultIfEmpty(statusMessage, + "COMPLETE".equals(requestState) ? + "Service Instance was created successfully." : + ("Service Instance was " + requestState.toLowerCase() + " successfully.")); + } + + private String getTimeNow() { + return getTimeHoursAgo(0); + } + + private String getTimeHoursAgo(int delta) { + Instant instant = Instant.now(); + Instant instantMinus = instant.minus(delta, ChronoUnit.HOURS); + ZonedDateTime dateDayAgo = ZonedDateTime.ofInstant(instantMinus, ZoneOffset.UTC); + DateTimeFormatter formatter = DateTimeFormatter.RFC_1123_DATE_TIME; + return formatter.format(dateDayAgo); } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.java new file mode 100644 index 000000000..3d83ca55d --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.java @@ -0,0 +1,179 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import static java.util.Collections.singletonList; + +import com.google.common.collect.ImmutableMap; +import java.util.List; +import java.util.Map; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public class PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork extends BaseMSOPreset { + + public PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork(ResponseDetails parentDetails, ResponseDetails childDetails, String parentInstanceId) { + this.parentDetails = parentDetails; + this.childDetails = childDetails; + this.parentInstanceId = parentInstanceId; + } + + public static class ResponseDetails { + public final String instanceName; + public final String requestId; + public final String status; + public final String type; + + public ResponseDetails(String instanceName, String requestId, String status, String type) { + this.instanceName = instanceName; + this.requestId = requestId; + this.status = status; + this.type = type; + } + } + + protected final ResponseDetails parentDetails; + protected final ResponseDetails childDetails; + protected final String parentInstanceId; + + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/orchestrationRequests/v."; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("filter", singletonList("serviceInstanceId:EQUALS:"+ parentInstanceId)); + } + + @Override + public Object getResponseBody() { + return "{" + + " \"requestList\": [{" + + " \"request\": {" + + " \"requestId\": \""+ parentDetails.requestId+"\"," + + " \"startTime\": \"Mon, 05 Nov 2018 09:22:23 GMT\"," + + " \"requestScope\": \""+ parentDetails.type+"\"," + + " \"requestType\": \"createInstance\"," + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelInvariantId\": \"1469946d-d566-467e-867b-88b29f6cb6c7\"," + + " \"modelType\": \""+ parentDetails.type+"\"," + + " \"modelName\": \"FCGI_5G_NC\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelVersionId\": \"ed2a3691-c3f3-4ac3-98b3-b0b12acfd1b1\"," + + " \"modelUuid\": \"ed2a3691-c3f3-4ac3-98b3-b0b12acfd1b1\"," + + " \"modelInvariantUuid\": \"1469946d-d566-467e-867b-88b29f6cb6c7\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"instanceName\": \""+ parentDetails.instanceName+"\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"subscriberInfo\": {" + + " \"globalSubscriberId\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }," + + " \"requestParameters\": {" + + " \"subscriptionServiceType\": \"TYLER SILVIA\"," + + " \"aLaCarte\": true," + + " \"testApi\": \"VNF_API\"" + + " }," + + " \"project\": {" + + " \"projectName\": \"DFW\"" + + " }," + + " \"owningEntity\": {" + + " \"owningEntityId\": \"3f592a6f-459b-435e-b0d4-59959ab1d385\"," + + " \"owningEntityName\": \"own1\"" + + " }" + + " }," + + " \"instanceReferences\": {" + + " \""+parentDetails.type+"InstanceId\": \"f4c4d4f7-311b-4ecb-bb86-eb3138aac0fb\"," + + " \""+parentDetails.type+"InstanceName\": \""+parentDetails.instanceName+"\"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"requestStatus\": {" + + " \"requestState\": \""+ parentDetails.status+"\"," + + " \"statusMessage\": \"STATUS: "+parentDetails.type+" Instance was created successfully.\"," + + " \"percentProgress\": 100," + + " \"finishTime\": \"Wed, 07 Nov 2018 09:22:35 GMT\"" + + " }" + + " }" + + " }, {" + + " \"request\": {" + + " \"requestId\": \""+childDetails.requestId+"\"," + + " \"startTime\": \"Mon, 05 Nov 2018 09:22:41 GMT\"," + + " \"requestScope\": \""+childDetails.type+"\"," + + " \"requestType\": \"createInstance\"," + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelCustomizationName\": \"FCGI 0\"," + + " \"modelInvariantId\": \"ba2ee320-23ce-4d2e-94dd-1ec450cec62c\"," + + " \"modelType\": \""+childDetails.type+"\"," + + " \"modelName\": \"FCGI\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelCustomizationUuid\": \"de9b7aea-9727-4a7c-8e72-292263fb61a9\"," + + " \"modelVersionId\": \"0d23f7bc-eee4-4151-9fb9-37f5bea834c2\"," + + " \"modelCustomizationId\": \"de9b7aea-9727-4a7c-8e72-292263fb61a9\"," + + " \"modelUuid\": \"0d23f7bc-eee4-4151-9fb9-37f5bea834c2\"," + + " \"modelInvariantUuid\": \"ba2ee320-23ce-4d2e-94dd-1ec450cec62c\"," + + " \"modelInstanceName\": \"FCGI 0\"" + + " }," + + " \"requestInfo\": {" + + " \"productFamilyId\": \"e433710f-9217-458d-a79d-1c7aff376d89\"," + + " \"source\": \"VID\"," + + " \"instanceName\": \""+childDetails.instanceName+"\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"relatedInstanceList\": [{" + + " \"relatedInstance\": {" + + " \"instanceId\": \"f4c4d4f7-311b-4ecb-bb86-eb3138aac0fb\"," + + " \"modelInfo\": {" + + " \"modelInvariantId\": \"1469946d-d566-467e-867b-88b29f6cb6c7\"," + + " \"modelType\": \"service\"," + + " \"modelName\": \"FCGI_5G_NC\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelVersionId\": \"ed2a3691-c3f3-4ac3-98b3-b0b12acfd1b1\"," + + " \"modelUuid\": \"ed2a3691-c3f3-4ac3-98b3-b0b12acfd1b1\"," + + " \"modelInvariantUuid\": \"1469946d-d566-467e-867b-88b29f6cb6c7\"" + + " }" + + " }" + + " }" + + " ]," + + " \"cloudConfiguration\": {" + + " \"tenantId\": \"460f35aeb53542dc9f77105066483e83\"," + + " \"cloudOwner\": \"irma-aic\"," + + " \"lcpCloudRegionId\": \"olson5b\"" + + " }," + + " \"requestParameters\": {}," + + " \"platform\": {" + + " \"platformName\": \"plat1\"" + + " }," + + " \"lineOfBusiness\": {" + + " \"lineOfBusinessName\": \"ECOMP\"" + + " }" + + " }," + + " \"instanceReferences\": {" + + " \""+parentDetails.type+"InstanceId\": \"f4c4d4f7-311b-4ecb-bb86-eb3138aac0fb\"," + + " \""+childDetails.type+"InstanceId\": \"2f668980-7dbc-4231-a67c-8b69cd266b3a\"," + + " \""+childDetails.type+"InstanceName\": \""+childDetails.instanceName+"\"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"requestStatus\": {" + + " \"requestState\": \""+childDetails.status+"\"," + + " \"statusMessage\": \"STATUS: "+childDetails.type+" has been created successfully.\"," + + " \"percentProgress\": 100," + + " \"finishTime\": \"Wed, 07 Nov 2018 09:22:45 GMT\"" + + " }" + + " }" + + " }" + + " ]" + + "}"; + + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByRequestId.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByRequestId.java new file mode 100644 index 000000000..69780d0aa --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByRequestId.java @@ -0,0 +1,85 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import static java.util.Collections.singletonList; + +import com.google.common.collect.ImmutableMap; +import java.util.List; +import java.util.Map; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public class PresetMSOOrchestrationRequestsGetByRequestId extends BaseMSOPreset { + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/orchestrationRequests/v."; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("filter", singletonList("requestId:EQUALS:405652f4-ceb3-4a75-9474-8aea71480a77")); + } + + @Override + public Object getResponseBody() { + return "" + + "{ " + + " \"requestList\": [{ " + + " \"request\": {" + + " \"requestId\": \"405652f4-ceb3-4a75-9474-8aea71480a77\"," + + " \"startTime\": \"Mon, 13 Aug 2018 18:13:28 GMT\"," + + " \"requestScope\": \"service\"," + + " \"requestType\": \"createInstance\"," + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelInvariantId\": \"c42c7d13-435e-4a38-84e5-158972673ff2\"," + + " \"modelType\": \"service\"," + + " \"modelName\": \"CGWY27-SVC\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelVersionId\": \"c0e6858a-e467-412c-9766-3872f03ac0ab\"," + + " \"modelUuid\": \"c0e6858a-e467-412c-9766-3872f03ac0ab\"," + + " \"modelInvariantUuid\": \"c42c7d13-435e-4a38-84e5-158972673ff2\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"cb4449\"" + + " }," + + " \"subscriberInfo\": {" + + " \"globalSubscriberId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" + + " }," + + " \"requestParameters\": {" + + " \"subscriptionServiceType\": \"Kennedy\"," + + " \"aLaCarte\": true," + + " \"testApi\": \"VNF_API\"" + + " }," + + " \"project\": {" + + " \"projectName\": \"Kennedy\"" + + " }," + + " \"owningEntity\": {" + + " \"owningEntityId\": \"10c645f5-9924-4b89-bec0-b17cf49d3cad\"," + + " \"owningEntityName\": \"EMANUEL-CORE\"" + + " }" + + " }," + + " \"instanceReferences\": {" + + " \"requestorId\": \"cb4449\"" + + " }," + + " \"requestStatus\": {" + + " \"requestState\": \"FAILED\"," + + " \"statusMessage\": \"Service Instance was failed.\"," + + " \"percentProgress\": 100," + + " \"finishTime\": \"Mon, 13 Aug 2018 18:13:39 GMT\"" + + " }" + + " }" + + "}" + + " ] " + + "} "; + + + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByServiceInstanceId.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByServiceInstanceId.java new file mode 100644 index 000000000..58686f26b --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetByServiceInstanceId.java @@ -0,0 +1,158 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import static java.util.Collections.singletonList; + +import com.google.common.collect.ImmutableMap; +import java.util.List; +import java.util.Map; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public class PresetMSOOrchestrationRequestsGetByServiceInstanceId extends BaseMSOPreset { + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/orchestrationRequests/v."; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("filter", singletonList("serviceInstanceId:EQUALS:bc305d54-75b4-431b-adb2-eb6b9e546014")); + } + + @Override + public Object getResponseBody() { + return "" + + "{ " + + " \"requestList\": [{ " + + " \"request\": {" + + " \"requestId\": \"405652f4-ceb3-4a75-9474-8aea71480a77\"," + + " \"startTime\": \"Mon, 13 Aug 2018 18:13:28 GMT\"," + + " \"requestScope\": \"service\"," + + " \"requestType\": \"createInstance\"," + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelInvariantId\": \"c42c7d13-435e-4a38-84e5-158972673ff2\"," + + " \"modelType\": \"service\"," + + " \"modelName\": \"CGWY27-SVC\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelVersionId\": \"c0e6858a-e467-412c-9766-3872f03ac0ab\"," + + " \"modelUuid\": \"c0e6858a-e467-412c-9766-3872f03ac0ab\"," + + " \"modelInvariantUuid\": \"c42c7d13-435e-4a38-84e5-158972673ff2\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"instanceName\": \"instance name 1\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"cb4449\"" + + " }," + + " \"subscriberInfo\": {" + + " \"globalSubscriberId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" + + " }," + + " \"requestParameters\": {" + + " \"subscriptionServiceType\": \"Kennedy\"," + + " \"aLaCarte\": true," + + " \"testApi\": \"VNF_API\"" + + " }," + + " \"project\": {" + + " \"projectName\": \"Kennedy\"" + + " }," + + " \"owningEntity\": {" + + " \"owningEntityId\": \"10c645f5-9924-4b89-bec0-b17cf49d3cad\"," + + " \"owningEntityName\": \"EMANUEL-CORE\"" + + " }" + + " }," + + " \"instanceReferences\": {" + + " \"serviceInstanceId\": \"64f3123a-f9a8-4591-b481-d662134bcb52\"," + + " \"serviceInstanceName\": \"CGWY27-SVC-olson5b\"," + + " \"requestorId\": \"cb4449\"" + + " }," + + " \"requestStatus\": {" + + " \"requestState\": \"COMPLETE\"," + + " \"statusMessage\": \"Service Instance was created successfully.\"," + + " \"percentProgress\": 100," + + " \"finishTime\": \"Mon, 13 Aug 2018 18:13:39 GMT\"" + + " }" + + " }" + + "},{" + + " \"request\":{" + + " \"requestId\":\"688d40cd-6bfd-4a4b-95f4-5e4ffa6d6fc5\"," + + " \"startTime\":\"Mon, 13 Aug 2018 18:15:14 GMT\"," + + " \"requestScope\":\"vnf\"," + + " \"requestType\":\"createInstance\"," + + " \"requestDetails\":{" + + " \"modelInfo\":{" + + " \"modelCustomizationName\":\"CGWY27-VF 0\"," + + " \"modelInvariantId\":\"8f508753-a546-48be-b931-2c949e215972\"," + + " \"modelType\":\"vnf\"," + + " \"modelName\":\"CGWY27-VF\"," + + " \"modelVersion\":\"1.0\"," + + " \"modelCustomizationUuid\":\"fa35ceb6-38de-428a-93b2-89be64c19f86\"," + + " \"modelVersionId\":\"4d279e16-de09-4108-b32f-82b05df2f41a\"," + + " \"modelCustomizationId\":\"fa35ceb6-38de-428a-93b2-89be64c19f86\"," + + " \"modelUuid\":\"4d279e16-de09-4108-b32f-82b05df2f41a\"," + + " \"modelInvariantUuid\":\"8f508753-a546-48be-b931-2c949e215972\"," + + " \"modelInstanceName\":\"CGWY27-VF 0\"" + + " }," + + " \"requestInfo\":{" + + " \"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"," + + " \"source\":\"VID\"," + + " \"instanceName\":\"instance name 2\"," + + " \"suppressRollback\":false," + + " \"requestorId\":\"cb4449\"" + + " }," + + " \"relatedInstanceList\":[" + + " {" + + " \"relatedInstance\":{" + + " \"instanceId\":\"64f3123a-f9a8-4591-b481-d662134bcb52\"," + + " \"modelInfo\":{" + + " \"modelInvariantId\":\"c42c7d13-435e-4a38-84e5-158972673ff2\"," + + " \"modelType\":\"service\"," + + " \"modelName\":\"CGWY27-SVC\"," + + " \"modelVersion\":\"1.0\"," + + " \"modelVersionId\":\"c0e6858a-e467-412c-9766-3872f03ac0ab\"," + + " \"modelUuid\":\"c0e6858a-e467-412c-9766-3872f03ac0ab\"," + + " \"modelInvariantUuid\":\"c42c7d13-435e-4a38-84e5-158972673ff2\"" + + " }" + + " }" + + " }" + + " ]," + + " \"cloudConfiguration\":{" + + " \"tenantId\":\"8830e9086a0f40cc9cf868e792602c4d\"," + + " \"lcpCloudRegionId\":\"olson5b\"" + + " }," + + " \"requestParameters\":{" + + " \"testApi\":\"VNF_API\"" + + " }," + + " \"platform\":{" + + " \"platformName\":\"AIC\"" + + " }," + + " \"lineOfBusiness\":{" + + " \"lineOfBusinessName\":\"EMANUEL-CONSUMER\"" + + " }" + + " }," + + " \"instanceReferences\":{" + + " \"serviceInstanceId\":\"64f3123a-f9a8-4591-b481-d662134bcb52\"," + + " \"vnfInstanceId\":\"96c98f10-d20a-47a9-a790-94e3ac3dfb7e\"," + + " \"vnfInstanceName\":\"zolson5bcgwy22\"," + + " \"requestorId\":\"cb4449\"" + + " }," + + " \"requestStatus\":{" + + " \"requestState\":\"COMPLETE\"," + + " \"statusMessage\":\"Vnf has been created successfully.\"," + + " \"percentProgress\":100," + + " \"finishTime\":\"Mon, 13 Aug 2018 18:15:23 GMT\"" + + " }" + + " }" + + "}"+ + " ] " + + "} "; + + + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyInstanceStatusesGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyInstanceStatusesGet.java new file mode 100644 index 000000000..63d6110ba --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyInstanceStatusesGet.java @@ -0,0 +1,160 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +import java.util.List; +import java.util.Map; + +import static java.util.Collections.singletonList; + +public class PresetMSOOrchestrationRequestsManyInstanceStatusesGet extends BaseMSOPreset { + + + private String instanceIdType; + + private String instanceType; + + + public PresetMSOOrchestrationRequestsManyInstanceStatusesGet(String instanceIdType, String instanceType) { + this.instanceIdType = instanceIdType; + this.instanceType = instanceType; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/orchestrationRequests/v."; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("filter", singletonList(instanceIdType+":EQUALS:df305d54-75b4-431b-adb2-eb6b9e5460df")); + } + + @Override + public Object getResponseBody() { + return "" + + "{ " + + " \"requestList\": [{ " + + " \"request\": { " + + " \"requestId\": \"28502bd2-3aff-4a03-9f2b-5a0d1cb1ca24\", " + + " \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\", " + + " \"instanceReferences\": { " + + " \"instanceGroupId\": \"df305d54-75b4-431b-adb2-eb6b9e5460df\" " + + " }, " + + " \"requestScope\": \""+instanceType+"\", " + + " \"requestType\": \"createInstance\", " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \""+instanceType+"\", " + + " \"modelVersionId\": \"ddcbbf3d-f2c1-4ca0-8852-76a807285efc\" " + + " }, " + + " \"requestInfo\": { " + + " \"instanceName\": \"groupTestName\", " + + " \"source\": \"VID\", " + + " \"suppressRollback\": true, " + + " \"requestorId\": \"ah2345\" " + + " } " + + " }, " + + " \"requestStatus\": { " + + " \"timestamp\": \"Thu, 04 Jun 2009 02:53:39 GMT\", " + + " \"requestState\": \"IN_PROGRESS\", " + + " \"statusMessage\": \""+instanceType+" instance creation\", " + + " \"percentProgress\": \"50\" " + + " } " + + " } " + + " }, { " + + " \"request\": { " + + " \"requestId\": \"28502bd2-3aff-4a03-9f2b-5a0d1cb1ca24\", " + + " \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\", " + + " \"instanceReferences\": { " + + " \"instanceGroupId\": \"df305d54-75b4-431b-adb2-eb6b9e5460df\" " + + " }, " + + " \"requestScope\": \""+instanceType+"\", " + + " \"requestType\": \"createInstance\", " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \""+instanceType+"\", " + + " \"modelVersionId\": \"ddcbbf3d-f2c1-4ca0-8852-76a807285efc\" " + + " }, " + + " \"requestInfo\": { " + + " \"instanceName\": \"groupTestName\", " + + " \"source\": \"VID\", " + + " \"suppressRollback\": true, " + + " \"requestorId\": \"ah2345\" " + + " } " + + " }, " + + " \"requestStatus\": { " + + " \"timestamp\": \"Thu, 04 Jun 2009 02:53:39 GMT\", " + + " \"requestState\": \"COMPLETE\", " + + " \"statusMessage\": \""+instanceType+" instance creation\", " + + " \"percentProgress\": \"100\" " + + " } " + + " } " + + " }, { " + + " \"request\": { " + + " \"requestId\": \"f711f0ff-24b6-4d7f-9314-4b4eae15f48c\", " + + " \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\", " + + " \"instanceReferences\": { " + + " \"instanceGroupId\": \"df305d54-75b4-431b-adb2-eb6b9e5460df\" " + + " }, " + + " \"requestScope\": \""+instanceType+"\", " + + " \"requestType\": \"deleteInstance\", " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \""+instanceType+"\", " + + " \"modelVersionId\": \"ddcbbf3d-f2c1-4ca0-8852-76a807285efc\" " + + " }, " + + " \"requestInfo\": { " + + " \"instanceName\": \"groupTestName\", " + + " \"source\": \"VID\", " + + " \"suppressRollback\": true, " + + " \"requestorId\": \"ah2345\" " + + " } " + + " }, " + + " \"requestStatus\": { " + + " \"timestamp\": \"Thu, 04 Jun 2009 02:53:39 GMT\", " + + " \"requestState\": \"IN_PROGRESS\", " + + " \"statusMessage\": \""+instanceType+" instance deletion\", " + + " \"percentProgress\": \"50\" " + + " } " + + " } " + + " }, { " + + " \"request\": { " + + " \"requestId\": \"f711f0ff-24b6-4d7f-9314-4b4eae15f48c\", " + + " \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\", " + + " \"instanceReferences\": { " + + " \"instanceGroupId\": \"df305d54-75b4-431b-adb2-eb6b9e5460df\" " + + " }, " + + " \"requestScope\": \""+instanceType+"\", " + + " \"requestType\": \"deleteInstance\", " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \""+instanceType+"\", " + + " \"modelVersionId\": \"ddcbbf3d-f2c1-4ca0-8852-76a807285efc\" " + + " }, " + + " \"requestInfo\": { " + + " \"instanceName\": \"groupTestName\", " + + " \"source\": \"VID\", " + + " \"suppressRollback\": true, " + + " \"requestorId\": \"ah2345\" " + + " } " + + " }, " + + " \"requestStatus\": { " + + " \"timestamp\": \"Thu, 04 Jun 2009 02:53:39 GMT\", " + + " \"requestState\": \"COMPLETE\", " + + " \"statusMessage\": \""+instanceType+" instance deletion\", " + + " \"percentProgress\": \"100\" " + + " } " + + " } " + + " } " + + " ] " + + "} "; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyStatusesGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyStatusesGet.java new file mode 100644 index 000000000..268103588 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyStatusesGet.java @@ -0,0 +1,210 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import com.google.common.collect.ImmutableMap; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +import java.util.List; +import java.util.Map; + +import static java.util.Collections.singletonList; + +public class PresetMSOOrchestrationRequestsManyStatusesGet extends BaseMSOPreset { + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/orchestrationRequests/v."; + } + + @Override + public Map getQueryParams() { + return ImmutableMap.of("filter", singletonList("requestExecutionDate:EQUALS:01-01-2100")); + } + + @Override + public Object getResponseBody() { + return "" + + "{ " + + " \"requestList\": [{ " + + " \"request\": { " + + " \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e333\", " + + " \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\", " + + " \"instanceReferences\": { " + + " \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\" " + + " }, " + + " \"requestScope\": \"vnf\", " + + " \"requestType\": \"updateInstance\", " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\", " + + " \"modelVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\", " + + " \"modelName\": \"WanBonding\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"subscriberInfo\": { " + + " \"globalSubscriberId\": \"C12345\", " + + " \"subscriberName\": \"General Electric Division 12\" " + + " }, " + + " \"requestInfo\": { " + + " \"instanceName\": \"WanBonding Service\", " + + " \"source\": \"VID\", " + + " \"suppressRollback\": true, " + + " \"requestorId\": \"ah2345\" " + + " }, " + + " \"requestParameters\": { " + + " \"subscriptionServiceType\": \"Trinity\" " + + " } " + + " }, " + + " \"requestStatus\": { " + + " \"timestamp\": \"Thu, 04 Jun 2009 02:53:39 GMT\", " + + " \"requestState\": \"Complete\", " + + " \"statusMessage\": \"Service created successfully\", " + + " \"percentProgress\": \"100\" " + + " } " + + " } " + + " }, { " + + " \"request\": { " + + " \"requestId\": \"25faf364-6031-4f58-9703-26955815562a\", " + + " \"startTime\": \"Thu, 30 Jun 2009 03:52:59 GMT\", " + + " \"instanceReferences\": { " + + " \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\" " + + " }, " + + " \"requestScope\": \"vnf\", " + + " \"requestType\": \"applyUpdatedConfig\", " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\", " + + " \"modelName\": \"WanBonding\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"requestInfo\": { " + + " \"source\": \"VID\" " + + " } " + + " }, " + + " \"requestStatus\": { " + + " \"timestamp\": \"Thu, 30 Jun 2009 03:53:39 GMT\", " + + " \"requestState\": \"IN_PROGRESS\", " + + " \"statusMessage\": \"\", " + + " \"percentProgress\": \"30\" " + + " } " + + " } " + + " }, { " + + " \"request\": { " + + " \"requestId\": \"eaee7411-9281-4c25-a65f-aad5a725a61a\", " + + " \"startTime\": \"Thu, 30 Jun 2009 03:52:59 GMT\", " + + " \"instanceReferences\": { " + + " \"serviceInstanceId\": \"28d8a15f-c32c-475f-a7ae-5d23f3caee0e\" " + + " }, " + + " \"requestScope\": \"vnf\", " + + " \"requestType\": \"applyUpdatedConfig\", " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\", " + + " \"modelName\": \"WanBonding\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"requestInfo\": { " + + " \"source\": \"VID\" " + + " } " + + " }, " + + " \"requestStatus\": { " + + " \"timestamp\": \"Thu, 30 Jun 2009 03:53:39 GMT\", " + + " \"requestState\": \"PENDING\", " + + " \"statusMessage\": \"\", " + + " \"percentProgress\": \"30\" " + + " } " + + " } " + + " }, { " + + " \"request\": { " + + " \"requestId\": \"da6c17ba-4e8c-4983-b000-e4dcdbb60a51\", " + + " \"startTime\": \"Thu, 30 Jun 2009 03:52:59 GMT\", " + + " \"instanceReferences\": { " + + " \"serviceInstanceId\": \"39b5f85b-60bd-4ca6-8586-8340182b89b7\" " + + " }, " + + " \"requestScope\": \"vnf\", " + + " \"requestType\": \"applyUpdatedConfig\", " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\", " + + " \"modelName\": \"WanBonding\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"requestInfo\": { " + + " \"source\": \"VID\" " + + " } " + + " }, " + + " \"requestStatus\": { " + + " \"timestamp\": \"Thu, 30 Jun 2009 03:53:39 GMT\", " + + " \"requestState\": \"PENDING_MANUAL_TASK\", " + + " \"statusMessage\": \"\", " + + " \"percentProgress\": \"30\" " + + " } " + + " } " + + " }, { " + + " \"request\": { " + + " \"requestId\": \"7d6b6261-bede-4bfb-bde3-f225d63ee315\", " + + " \"startTime\": \"Thu, 30 Jun 2009 03:52:59 GMT\", " + + " \"instanceReferences\": { " + + " \"serviceInstanceId\": \"d4f74570-a03b-40f6-abe1-e979467ebbc1\" " + + " }, " + + " \"requestScope\": \"vnf\", " + + " \"requestType\": \"applyUpdatedConfig\", " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\", " + + " \"modelName\": \"WanBonding\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"requestInfo\": { " + + " \"source\": \"VID\" " + + " } " + + " }, " + + " \"requestStatus\": { " + + " \"timestamp\": \"Thu, 30 Jun 2009 03:53:39 GMT\", " + + " \"requestState\": \"STAM STATE\", " + + " \"statusMessage\": \"MSO just had a bad day :-(\", " + + " \"percentProgress\": \"30\" " + + " } " + + " } " + + " }, { " + + " \"request\": { " + + " \"requestId\": \"08e4a296-2fac-49c9-8a29-90c7eeee5ac2\", " + + " \"startTime\": \"Thu, 30 Jun 2009 03:52:59 GMT\", " + + " \"instanceReferences\": { " + + " \"serviceInstanceId\": \"48962b01-f021-4f75-ad52-1d54b6ee0bdb\" " + + " }, " + + " \"requestScope\": \"vnf\", " + + " \"requestType\": \"applyUpdatedConfig\", " + + " \"requestDetails\": { " + + " \"modelInfo\": { " + + " \"modelType\": \"service\", " + + " \"modelInvariantId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\", " + + " \"modelName\": \"WanBonding\", " + + " \"modelVersion\": \"1.0\" " + + " }, " + + " \"requestInfo\": { " + + " \"source\": \"VID\" " + + " } " + + " }, " + + " \"requestStatus\": { " + + " \"timestamp\": \"Thu, 30 Jun 2009 03:53:39 GMT\", " + + " \"requestState\": \"FAILED\", " + + " \"statusMessage\": \"\", " + + " \"percentProgress\": \"30\" " + + " } " + + " } " + + " } " + + " ] " + + "} "; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyStatusesInvalidResponseGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyStatusesInvalidResponseGet.java new file mode 100644 index 000000000..10222fee8 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsManyStatusesInvalidResponseGet.java @@ -0,0 +1,19 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +public class PresetMSOOrchestrationRequestsManyStatusesInvalidResponseGet extends PresetMSOOrchestrationRequestsManyStatusesGet { + private final int responseCode; + + public PresetMSOOrchestrationRequestsManyStatusesInvalidResponseGet(int responseCode) { + this.responseCode = responseCode; + } + + @Override + public int getResponseCode() { + return responseCode; + } + + @Override + public Object getResponseBody() { + return "this payload is an invalid json"; + } +} 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 index 881cc4634..9997f0a6d 100644 --- 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 @@ -1,6 +1,6 @@ package org.onap.simulator.presetGenerator.presets.mso; -public class PresetMSOServiceInstanceGen2ErrorResponse extends PresetMSOBaseCreateServiceInstancePost { +public class PresetMSOServiceInstanceGen2ErrorResponse extends PresetMSOBaseCreateInstancePost { private final int responseCode; @@ -15,7 +15,7 @@ public class PresetMSOServiceInstanceGen2ErrorResponse extends PresetMSOBaseCrea @Override public String getReqPath() { - return getRootPath() + "/serviceInstantiation/v7/serviceInstances/assign"; + return getRootPath() + "/serviceInstantiation/v./serviceInstances/assign"; } @Override 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 index 98187b9a2..b851da2d2 100644 --- 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 @@ -1,22 +1,55 @@ package org.onap.simulator.presetGenerator.presets.mso; -import java.util.Map; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VFM_NAME1; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VFM_NAME2; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VG_NAME; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.VNF_NAME; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.*; +import java.util.Map; +import vid.automation.test.infra.Features; -public abstract class PresetMSOServiceInstanceGen2WithNames extends PresetMSOBaseCreateServiceInstancePost{ +public abstract class PresetMSOServiceInstanceGen2WithNames extends PresetMSOBaseCreateInstancePost { public enum Keys { - SERVICE_NAME, VNF_NAME, VFM_NAME1, VFM_NAME2, VG_NAME + SERVICE_NAME, VNF_NAME, VNF_NAME2, VFM_NAME1, VFM_NAME2, VG_NAME + , VNF_GROUP1_ACTION, RELATED_VNF1_ACTION, RELATED_VNF2_ACTION, } - private final Map names; + protected final Map names; - private final String suffix; + protected final String suffix; public PresetMSOServiceInstanceGen2WithNames(Map names, int suffix) { + this(names, suffix, PresetMSOBaseCreateInstancePost.DEFAULT_REQUEST_ID); + } + + public PresetMSOServiceInstanceGen2WithNames(Map names, int suffix, String requestId) { + super(requestId); + this.names = names; + this.suffix = formatSuffix(suffix); + } + + public PresetMSOServiceInstanceGen2WithNames(Map names, int suffix, String requestId, String responseInstanceId) { + super(requestId, responseInstanceId); this.names = names; - this.suffix = "_" + String.format("%03d", suffix); + this.suffix = formatSuffix(suffix); + } + + @Override + public boolean isStrictMatch() { + return true; + } + + protected String getVnfInstanceParams() { + if (!Features.FLAG_SHIFT_VFMODULE_PARAMS_TO_VNF.isActive()) { + return ""; + } + return " {" + + " \"vmx_int_net_len\": \"24\"," + + " \"vre_a_volume_size_0\": \"100\"," + + " \"availability_zone_0\": \"mtpocdv-kvm-az01\"" + + "}"; } @Override @@ -45,7 +78,7 @@ public abstract class PresetMSOServiceInstanceGen2WithNames extends PresetMSOBas " \"productFamilyId\": \"myProductFamilyId\"," + " \"source\": \"VID\"," + " \"suppressRollback\": false," + - " \"requestorId\": \"vid1\"" + + " \"requestorId\": \"us16807000\"" + " }," + " \"requestParameters\": {" + " \"subscriptionServiceType\": \"mySubType\"," + @@ -71,7 +104,8 @@ public abstract class PresetMSOServiceInstanceGen2WithNames extends PresetMSOBas " \"modelType\": \"vnf\"" + " }," + " \"cloudConfiguration\": {" + - " \"lcpCloudRegionId\": \"mtn3\"," + + " \"lcpCloudRegionId\": \"hvf3\"," + + addCloudOwnerIfNeeded() + " \"tenantId\": \"greatTenant\"" + " }," + " \"platform\": {" + @@ -81,7 +115,7 @@ public abstract class PresetMSOServiceInstanceGen2WithNames extends PresetMSOBas " \"lineOfBusinessName\": \"lineOfBusinessName\"" + " }," + " \"productFamilyId\": \"myProductFamilyId\"," + - " \"instanceParams\": []," + + " \"instanceParams\": ["+getVnfInstanceParams()+"]," + " \"vfModules\": [" + " {" + " \"modelInfo\": {" + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoChangeManagementBase.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoChangeManagementBase.java new file mode 100644 index 000000000..758e15e6e --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoChangeManagementBase.java @@ -0,0 +1,28 @@ +package org.onap.simulator.presetGenerator.presets.mso.changeManagement; + +import org.apache.commons.lang3.StringUtils; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost; + +public abstract class PresetMsoChangeManagementBase extends PresetMSOBaseCreateInstancePost { + + protected final String serviceInstanceId; + protected final String vnfInstanceId; + private final String actionName; + + public PresetMsoChangeManagementBase(String serviceInstanceId, String vnfInstanceId, String actionName) { + super(DEFAULT_REQUEST_ID, vnfInstanceId); + this.serviceInstanceId = serviceInstanceId; + this.vnfInstanceId = vnfInstanceId; + this.actionName = actionName; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstances/v./" + serviceInstanceId + "/vnfs/"+vnfInstanceId+ getReqPathTrailer(); + } + + protected String getReqPathTrailer() { + return StringUtils.isEmpty(actionName) ? "" : "/"+ actionName; + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfInPlaceSoftwareUpdate.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfInPlaceSoftwareUpdate.java new file mode 100644 index 000000000..897db26bd --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfInPlaceSoftwareUpdate.java @@ -0,0 +1,37 @@ +package org.onap.simulator.presetGenerator.presets.mso.changeManagement; + +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; +import org.springframework.http.HttpMethod; + +public class PresetMsoVnfInPlaceSoftwareUpdate extends PresetMsoChangeManagementBase { + + public PresetMsoVnfInPlaceSoftwareUpdate(String serviceInstanceId, String vnfInstanceId) { + super(serviceInstanceId, vnfInstanceId, "inPlaceSoftwareUpdate"); + this.cloudOwner = PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"mdt1\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"requestorId\": \"az2016\"" + + " }," + + " \"requestParameters\": {" + + " \"payload\": \"{\\\"existing_software_version\\\": \\\"3.1\\\", \\\"new_software_version\\\": \\\"3.2\\\", \\\"operations_timeout\\\": \\\"3600\\\"}\"" + + " }" + + " }" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfReplace.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfReplace.java new file mode 100644 index 000000000..cbdb8f5f6 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfReplace.java @@ -0,0 +1,58 @@ +package org.onap.simulator.presetGenerator.presets.mso.changeManagement; + +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; +import org.springframework.http.HttpMethod; + +public class PresetMsoVnfReplace extends PresetMsoChangeManagementBase { + + public PresetMsoVnfReplace(String serviceInstanceId, String vnfInstanceId) { + super(serviceInstanceId, vnfInstanceId, "replace"); + this.cloudOwner = PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelType\": \"vnf\"," + + " \"modelInvariantId\": \"ff5256d1-5a33-55df-13ab-12abad84e7ff\"," + + " \"modelVersionId\": \"254583ad-b38c-498b-bdbd-b8de5e07541b\"," + + " \"modelName\": \"vSAMP12\"," + + " \"modelVersion\": \"2.0\"," + + " \"modelCustomizationId\": \"c539433a-84a6-4082-a12e-5c9b00c3b960\"" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"mdt1\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"requestorId\": \"az2016\"" + + " }," + + " \"relatedInstanceList\": [{" + + " \"relatedInstance\": {" + + " \"instanceId\": \""+serviceInstanceId+"\"," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelInvariantId\": \"ff3514e3-5a33-55df-13ab-12abad84e7ff\"," + + " \"modelVersionId\": \"9ebb1521-2e74-47a4-aac7-e71a79f73a79\"," + + " \"modelName\": \"fakeModelName\"," + + " \"modelVersion\": \"2.0\"" + + " }" + + " }" + + " }" + + " ]," + + " \"requestParameters\": {" + + " \"rebuildVolumeGroups\": false" + + " }" + + " }" + + "}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfUpdate.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfUpdate.java new file mode 100644 index 000000000..dee516005 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfUpdate.java @@ -0,0 +1,67 @@ +package org.onap.simulator.presetGenerator.presets.mso.changeManagement; + +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; +import org.springframework.http.HttpMethod; + +public class PresetMsoVnfUpdate extends PresetMsoChangeManagementBase { + + + public PresetMsoVnfUpdate(String serviceInstanceId, String vnfInstanceId) { + super(serviceInstanceId, vnfInstanceId, ""); + this.cloudOwner = PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.PUT; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/" + vnfInstanceId; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelType\": \"vnf\"," + + " \"modelInvariantId\": \"ff5256d1-5a33-55df-13ab-12abad84e7ff\"," + + " \"modelVersionId\": \"254583ad-b38c-498b-bdbd-b8de5e07541b\"," + + " \"modelName\": \"vSAMP12\"," + + " \"modelVersion\": \"2.0\"," + + // TODO Ask ZITELLA, MICHAEL V if the field is mandatory. Vid currently not send it + //" \"modelCustomizationName\": \"vSAMP12 1\"," + + " \"modelCustomizationId\": \"c539433a-84a6-4082-a12e-5c9b00c3b960\"" + + " }," + + " \"cloudConfiguration\": {" + + " \"lcpCloudRegionId\": \"mdt1\"," + + addCloudOwnerIfNeeded() + + " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"az2016\"" + + " }," + + " \"relatedInstanceList\": [" + + " {" + + " \"relatedInstance\": {" + + " \"instanceId\": \""+serviceInstanceId+"\"," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelInvariantId\": \"ff3514e3-5a33-55df-13ab-12abad84e7ff\"," + + " \"modelVersionId\": \"9ebb1521-2e74-47a4-aac7-e71a79f73a79\"," + + " \"modelName\": \"fakeModelName\"," + + " \"modelVersion\": \"2.0\"" + + " }" + + " }" + + " }" + + " ]," + + " \"requestParameters\": {" + + " \"usePreload\": true" + + " }" + + "}}"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOActOnConfiguration.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOActOnConfiguration.java new file mode 100644 index 000000000..6c4b722d6 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOActOnConfiguration.java @@ -0,0 +1,70 @@ +package org.onap.simulator.presetGenerator.presets.mso.configuration; + +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost; + +public class PresetMSOActOnConfiguration extends PresetMSOBaseCreateInstancePost { + + private final String action; + + public PresetMSOActOnConfiguration(String action) { + this.action = action; + this.cloudOwner = "att-nc"; + } + + public PresetMSOActOnConfiguration(String action, String requestId, String responseInstanceId) { + super(requestId, responseInstanceId); + this.action = action; + this.cloudOwner = "att-nc"; + } + + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstances/v./c187e9fe-40c3-4862-b73e-84ff056205f6/configurations/9533-config-LB1113/" + action; + } + + @Override + public Object getRequestBody() { + return "" + + "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelType\": \"configuration\"," + + " \"modelInvariantId\": \"model-invariant-id-9533\"," + + " \"modelVersionId\": \"model-version-id-9533\"," + + " \"modelCustomizationId\": \"08a181aa-72eb-435f-9593-e88a3ad0a86b\"" + + " }," + + " \"cloudConfiguration\": {" + + addCloudOwnerIfNeeded() + + " \"lcpCloudRegionId\": \"mdt1\"," + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"relatedInstanceList\": [{" + + " \"relatedInstance\": {" + + " \"instanceId\": \"c187e9fe-40c3-4862-b73e-84ff056205f6\"," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelInvariantId\": \"b7d923c9-6175-41f1-91ba-4565c4953408\"," + + " \"modelVersionId\": \"ee6d61be-4841-4f98-8f23-5de9da846ca7\"," + + " \"modelName\": \"ServiceContainerMultiplepProbes\"," + + " \"modelVersion\": \"1.0\"" + + " }" + + " }" + + " }" + + " ]," + + " \"requestParameters\": {" + + " \"userParams\": []" + + " }" + + " }" + + "}"; + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOCreateConfiguration.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOCreateConfiguration.java new file mode 100644 index 000000000..bba0f20d8 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSOCreateConfiguration.java @@ -0,0 +1,117 @@ +package org.onap.simulator.presetGenerator.presets.mso.configuration; + +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost; + +public class PresetMSOCreateConfiguration extends PresetMSOBaseCreateInstancePost { + + protected final String serviceInstanceId; + protected final boolean isError; + private final int errorCode; + private final String errorPayload; + + public PresetMSOCreateConfiguration(String serviceInstanceId) { + super("b6dc9806-b094-42f7-9386-a48de8218ce8", "f36f5734-e9df-4fbf-9f35-61be13f028a1"); + this.serviceInstanceId = serviceInstanceId; + this.cloudOwner = "irma-aic"; + this.isError = false; + this.errorCode = 0; + this.errorPayload = null; + } + + public PresetMSOCreateConfiguration(String serviceInstanceId, int errorCode, String errorPayload) { + super("b6dc9806-b094-42f7-9386-a48de8218ce8", "f36f5734-e9df-4fbf-9f35-61be13f028a1"); + this.serviceInstanceId = serviceInstanceId; + this.cloudOwner = "irma-aic"; + this.isError = true; + this.errorCode = errorCode; + this.errorPayload = errorPayload; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public int getResponseCode() { + return isError ? errorCode : super.getResponseCode(); + } + + @Override + public Object getResponseBody() { + return isError ? errorPayload : super.getResponseBody(); + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstances/v./" + this.serviceInstanceId + "/configurations"; + } + + @Override + public Object getRequestBody() { + return "" + + "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelType\": \"configuration\"," + + " \"modelInvariantId\": \"c30a024e-a6c6-4670-b73c-3df64eb57ff6\"," + + " \"modelVersionId\": \"f58d039d-4cfc-40ec-bd75-1f05f0458a6c\"," + + " \"modelName\": \"Port Mirroring Configuration By Policy\"," + + " \"modelVersion\": \"1.0\"," + + " \"modelCustomizationId\": \"4b7ebace-bad6-4526-9be6-bf248e20fc5f\"," + + " \"modelCustomizationName\": \"Port Mirroring Configuration By Policy 1\"" + + " }," + + " \"cloudConfiguration\": {" + + addCloudOwnerIfNeeded() + + " \"lcpCloudRegionId\": \"JANET25\"" + + " }," + + " \"requestInfo\": {" + + " \"instanceName\": \"dummy_instance\"," + + " \"source\": \"VID\"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"relatedInstanceList\": [" + + " {" + + " \"relatedInstance\": {" + + " \"instanceId\": \"c187e9fe-40c3-4862-b73e-84ff056205f6\"," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelInvariantId\": \"b7d923c9-6175-41f1-91ba-4565c4953408\"," + + " \"modelVersionId\": \"ee6d61be-4841-4f98-8f23-5de9da846ca7\"," + + " \"modelName\": \"ServiceContainerMultiplepProbes\"," + + " \"modelVersion\": \"1.0\"" + + " }" + + " }" + + " }," + + " {" + + " \"relatedInstance\": {" + + " \"instanceId\": \"9be14a4f-7367-4cf9-96a1-f08f10f485a7\"," + + " \"instanceDirection\": \"source\"," + + " \"modelInfo\": {" + + " \"modelType\": \"vnf\"," + + " \"modelInvariantId\": \"51f2c559-1aba-4fd4-bbf9-8cbbef85ff2a\"," + + " \"modelVersionId\": \"cb05b259-9f26-4b33-b96c-13c2c202c091\"," + + " \"modelName\": \"vf_vEPDG\"," + + " \"modelVersion\": \"2.0\"," + + " \"modelCustomizationId\": \"35aeaae9-74f7-4b6a-adda-65edb0110361\"" + + " }" + + " }" + + " }," + + " {" + + " \"relatedInstance\": {" + + " \"instanceName\": \"AS-pnf2-10219--as988q\"," + + " \"instanceDirection\": \"destination\"," + + " \"modelInfo\": {" + + " \"modelType\": \"pnf\"" + + " }" + + " }" + + " }" + + " ]," + + " \"requestParameters\": {" + + " \"userParams\": []" + + " }" + + " }" + + "}"; + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSODeleteConfiguration.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSODeleteConfiguration.java new file mode 100644 index 000000000..4d0582c91 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMSODeleteConfiguration.java @@ -0,0 +1,53 @@ +package org.onap.simulator.presetGenerator.presets.mso.configuration; + +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost; +import org.springframework.http.HttpMethod; + +public class PresetMSODeleteConfiguration extends PresetMSOBaseCreateInstancePost { + + public PresetMSODeleteConfiguration() { + this.cloudOwner = "att-nc"; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.DELETE; + } + + @Override + public boolean isStrictMatch() { + return true; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstances/v./c187e9fe-40c3-4862-b73e-84ff056205f6/configurations/9533-config-LB1113"; + } + + @Override + public Object getRequestBody() { + return "" + + "{" + + " \"requestDetails\": {" + + " \"cloudConfiguration\": {" + + addCloudOwnerIfNeeded() + + " \"lcpCloudRegionId\": \"mdt1\"" + + " }," + + " \"modelInfo\": {" + + " \"modelCustomizationId\": \"08a181aa-72eb-435f-9593-e88a3ad0a86b\"," + + " \"modelInvariantId\": \"model-invariant-id-9533\"," + + " \"modelVersionId\": \"model-version-id-9533\"," + + " \"modelType\": \"configuration\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"requestParameters\": {" + + " \"userParams\": []" + + " }" + + " }" + + "}"; + } + +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMsoEnableDisablePort.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMsoEnableDisablePort.java new file mode 100644 index 000000000..db18e0104 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/configuration/PresetMsoEnableDisablePort.java @@ -0,0 +1,76 @@ +package org.onap.simulator.presetGenerator.presets.mso.configuration; + +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost; +import org.springframework.http.HttpMethod; + +public class PresetMsoEnableDisablePort extends PresetMSOBaseCreateInstancePost { + + private final String serviceInstanceId; + private final String configurationId; + private final String action; + + + public PresetMsoEnableDisablePort(String serviceInstanceId, String configurationId, String action) { + super("314cc766-b673-4a50-b9c5-471f68914585", serviceInstanceId); + this.serviceInstanceId = serviceInstanceId; + this.configurationId = configurationId; + this.action = action; + this.cloudOwner = PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public String getReqPath() { + return "/mso/serviceInstances/v./"+serviceInstanceId+"/configurations/"+configurationId+"/" + action; + } + + @Override + public Object getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"cloudConfiguration\": {" + + addCloudOwnerIfNeeded() + + " \"lcpCloudRegionId\": \"mdt1\"" + + " }," + + " \"modelInfo\": {" + + " \"modelCustomizationId\": \"08a181aa-72eb-435f-9593-e88a3ad0a86b\"," + + " \"modelInvariantId\": \"model-invariant-id-9533\"," + + " \"modelVersionId\": \"model-version-id-9533\"," + + " \"modelType\": \"configuration\"" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"requestorId\": \"us16807000\"" + + " }," + + " \"relatedInstanceList\": [" + + " {" + + " \"relatedInstance\": {" + + " \"instanceId\": \""+serviceInstanceId+"\"," + + " \"modelInfo\": {" + + " \"modelType\": \"service\"," + + " \"modelInvariantId\": \"b7d923c9-6175-41f1-91ba-4565c4953408\"," + + " \"modelName\": \"ServiceContainerMultiplepProbes\"," + + " \"modelVersionId\": \"ee6d61be-4841-4f98-8f23-5de9da846ca7\"," + + " \"modelVersion\": \"1.0\"" + + " }" + + " }" + + " }," + + " {" + + " \"relatedInstance\": {" + + " \"instanceId\": \"d35bf534-7d8e-4cb4-87f9-0a8bb6cd47b2\"," + + " \"instanceDirection\": \"source\"," + + " \"modelInfo\": {" + + " \"modelType\": \"connectionPoint\"" + + " }" + + " }" + + " }" + + " ]" + + " }" + + " }"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetGetSchedulerChangeManagementInvalidResponse.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetGetSchedulerChangeManagementInvalidResponse.java new file mode 100644 index 000000000..b79dc3ed2 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetGetSchedulerChangeManagementInvalidResponse.java @@ -0,0 +1,17 @@ +package org.onap.simulator.presetGenerator.presets.scheduler; + +public class PresetGetSchedulerChangeManagementInvalidResponse extends PresetGetSchedulerChangeManagements { + private int httpCode; + + public PresetGetSchedulerChangeManagementInvalidResponse(int httpCode) { + this.httpCode = httpCode; + } + + @Override + public int getResponseCode() { return httpCode; } + + @Override + public Object getResponseBody() { + return "this payload is an invalid json"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetGetSchedulerChangeManagements.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetGetSchedulerChangeManagements.java new file mode 100644 index 000000000..3763db2da --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetGetSchedulerChangeManagements.java @@ -0,0 +1,162 @@ +package org.onap.simulator.presetGenerator.presets.scheduler; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; +import org.springframework.http.HttpMethod; + +public class PresetGetSchedulerChangeManagements extends BasePreset { + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/scheduleDetails/"; + } + + @Override + protected String getRootPath() { + return "/scheduler/v1/ChangeManagement/schedules"; + } + + @Override + public Object getResponseBody() { + return "[" + + " {" + + " \"vnfName\": \"dbox0001v\"," + + " \"status\": \"Triggered\"," + + " \"aotsChangeId\": \"CHG000000000001\"," + + " \"aotsApprovalStatus\": \"Approved\"," + + " \"groupId\": \"groupId\"," + + " \"dispatchTime\": \"2018-05-09T14:05:43Z\"," + + " \"msoRequestId\": \"2fb4edd1-01c4-4fee-bd4a-4ae6282aa213\"," + + " \"scheduleRequest\": {" + + " \"id\": 1," + + " \"createDateTime\": \"2018-05-09T14:05:34Z\"," + + " \"optimizerAttemptsToSchedule\": 0," + + " \"optimizerTransactionId\": \"70f05563-6705-4be0-802a-8b6b78a69d63\"," + + " \"scheduleId\": \"70f05563-6705-4be0-802a-8b6b78a69d63\"," + + " \"scheduleName\": \"70f05563-6705-4be0-802a-8b6b78a69d63\"," + + " \"status\": \"Notifications Initiated\"," + + " \"userId\": \"wl849v\"," + + " \"domain\": \"ChangeManagement\"," + + " \"domainData\": [" + + " {" + + " \"id\": 1," + + " \"name\": \"WorkflowName\"," + + " \"value\": \"VNF In Place Software Update\"" + + " }," + + " {" + + " \"id\": 2," + + " \"name\": \"CallbackUrl\"," + + " \"value\": \"https://vid.onap.org:8000/vid/change-management/workflow/\"" + + " }," + + " {" + + " \"id\": 3," + + " \"name\": \"CallbackData\"," + + " \"value\": \"{\\\"requestType\\\":\\\"VNF In Place Software Update\\\",\\\"requestDetails\\\":[{\\\"vnfName\\\":\\\"dbox0001v\\\",\\\"vnfInstanceId\\\":\\\"815d38c0-b686-491c-9a74-0b49add524ca\\\",\\\"modelInfo\\\":{\\\"modelType\\\":\\\"vnf\\\",\\\"modelInvariantId\\\":\\\"59f4e0b2-e1b0-4e3b-bae3-e7b8c5d32985\\\",\\\"modelVersionId\\\":\\\"345643c1-3a51-423f-aac1-502e027d8dab\\\",\\\"modelName\\\":\\\"dbox0001v\\\",\\\"modelCustomizationId\\\":\\\"01ce23cb-d276-4d71-a5f1-f9d42d0df543\\\"},\\\"cloudConfiguration\\\":{\\\"lcpCloudRegionId\\\":\\\"dpa2b\\\",\\\"tenantId\\\":\\\"b60da4f71c1d4b35b8113d4eca6deaa1\\\"},\\\"requestInfo\\\":{\\\"source\\\":\\\"VID\\\",\\\"suppressRollback\\\":false,\\\"requestorId\\\":\\\"wl849v\\\"},\\\"relatedInstanceList\\\":[{\\\"relatedInstance\\\":{\\\"instanceId\\\":\\\"eb774932-e9fa-4c7f-bbc1-229b6b2b11e2\\\",\\\"modelInfo\\\":{\\\"modelType\\\":\\\"service\\\",\\\"modelInvariantId\\\":\\\"57dd617b-d64e-4441-a287-4d158b24ba65\\\",\\\"modelVersionId\\\":\\\"345643c1-3a51-423f-aac1-502e027d8dab\\\",\\\"modelName\\\":\\\"control_loop_dbe_svc\\\",\\\"modelVersion\\\":\\\"2.0\\\"}}}],\\\"requestParameters\\\":{\\\"payload\\\":\\\"{\\\\\\\"existing_software_version\\\\\\\":\\\\\\\"2\\\\\\\",\\\\\\\"new_software_version\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"operations_timeout\\\\\\\":\\\\\\\"3\\\\\\\"}\\\",\\\"testApi\\\":\\\"GR_API\\\"}}]}\"" + + " }" + + " ]," + + " \"scheduleApprovals\": []" + + " }," + + " \"schedulesId\": 0" + + " }," + + " {" + + " \"vnfName\": \"aaiaic25ctsf0002v\"," + + " \"vnfId\": \"\"," + + " \"status\": \"Cancelled\"," + + " \"aotsChangeId\": \"CHG000000000001\"," + + " \"aotsApprovalStatus\": \"Approved\"," + + " \"startTime\": \"2018-06-07T04:00:24Z\"," + + " \"finishTime\": \"2018-06-07T04:02:14Z\"," + + " \"groupId\": \"group\"," + + " \"lastInstanceStartTime\": \"2018-06-07T04:00:24Z\"," + + " \"policyId\": \"SNIRO_CM.TimeLimitAndVerticalTopology_pserver\"," + + " \"scheduleRequest\": {" + + " \"id\": 5," + + " \"createDateTime\": \"2018-06-06T13:00:25Z\"," + + " \"optimizerDateTime\": \"2018-06-06T13:00:34Z\"," + + " \"optimizerMessage\": \"A feasible scheduled has been found\"," + + " \"optimizerStatus\": \"complete\"," + + " \"optimizerAttemptsToSchedule\": 0," + + " \"optimizerReturnDateTime\": \"2018-06-06T13:07:02Z\"," + + " \"optimizerTransactionId\": \"01da00a6-9664-4db6-b97d-50847bc05144\"," + + " \"schedule\": \"[{\\\"groupId\\\":\\\"group\\\",\\\"startTime\\\":\\\"2018-06-07 04:00:24\\\",\\\"finishTime\\\":\\\"2018-06-07 04:02:14\\\",\\\"latestInstanceStartTime\\\":\\\"2018-06-07 04:00:24\\\",\\\"node\\\":[\\\"aaiaic25ctsf0002v\\\"]}]\"," + + " \"scheduleId\": \"01da00a6-9664-4db6-b97d-50847bc05144\"," + + " \"scheduleName\": \"01da00a6-9664-4db6-b97d-50847bc05144\"," + + " \"status\": \"Cancelled\"," + + " \"userId\": \"jf9860\"," + + " \"domain\": \"ChangeManagement\"," + + " \"deleteDateTime\": \"2018-06-06T13:07:11Z\"," + + " \"domainData\": [" + + " {" + + " \"id\": 5," + + " \"name\": \"CallbackData\"," + + " \"value\": \"{\\\"requestType\\\": \\\"Update\\\", \\\"requestDetails\\\": [{\\\"vnfInstanceId\\\": \\\"b8d99523-1e83-4fd1-b42f-849361ef7024\\\", \\\"relatedInstanceList\\\": [{\\\"relatedInstance\\\": {\\\"instanceId\\\": \\\"54ba3628-9ee5-4b32-8a2a-3abf001bed4e\\\", \\\"modelInfo\\\": {\\\"modelVersionId\\\": \\\"4ec07a2d-6bb5-4373-8ed6-4bc7ac1246fd\\\", \\\"modelVersion\\\": \\\"4.0\\\", \\\"modelName\\\": \\\"CHARLOTTE_2017_1011\\\", \\\"modelInvariantId\\\": \\\"e58733ef-43cb-4b6b-b641-922078b6c88b\\\", \\\"modelType\\\": \\\"service\\\"}}}], \\\"requestParameters\\\": {\\\"usePreload\\\": true}, \\\"requestInfo\\\": {\\\"source\\\": \\\"VID\\\", \\\"requestorId\\\": \\\"az2016\\\", \\\"suppressRollback\\\": false}, \\\"vnfName\\\": \\\"CHARLOTTE_2017_1011_oh22u_20171103\\\", \\\"modelInfo\\\": {\\\"modelVersionId\\\": \\\"4ec07a2d-6bb5-4373-8ed6-4bc7ac1246fd\\\", \\\"modelName\\\": \\\"CHARLOTTE_2017_1011_oh22u_20171103\\\", \\\"modelInvariantId\\\": \\\"93e16072-715a-42ef-9d0a-080052d6b716\\\", \\\"modelType\\\": \\\"vnf\\\", \\\"modelCustomizationId\\\": \\\"1779a999-ea17-4f31-98e9-75b6fbdd0acb\\\"}, \\\"cloudConfiguration\\\": {\\\"tenantId\\\": \\\"88a6ca3ee0394ade9403f075db23167e\\\", \\\"lcpCloudRegionId\\\": \\\"mdt1\\\"}}]}\"" + + " }," + + " {" + + " \"id\": 9," + + " \"name\": \"WorkflowName\"," + + " \"value\": \"Update\"" + + " }," + + " {" + + " \"id\": 13," + + " \"name\": \"CallbackUrl\"," + + " \"value\": \"http://127.0.0.1:8900/scheduler/v1/loopbacktest/vid\"" + + " }" + + " ]," + + " \"scheduleApprovals\": [" + + " {" + + " \"approvalDateTime\": \"2018-06-06T13:07:08Z\"," + + " \"status\": \"Accepted\"," + + " \"userId\": \"jf9860\"," + + " \"approvalTypeId\": 1" + + " }" + + " ]" + + " }," + + " \"schedulesId\": 0" + + " }," + + " {" + + " \"vnfName\": \"Zolson1MMSC04ee0f\"," + + " \"status\": \"Pending Schedule\"," + + " \"groupId\": \"\"," + + " \"policyId\": \"SNIRO.TimeLimitAndVerticalTopology\"," + + " \"scheduleRequest\": {" + + " \"id\": 9," + + " \"createDateTime\": \"2018-06-06T13:07:16Z\"," + + " \"optimizerDateTime\": \"2018-06-06T13:07:24Z\"," + + " \"optimizerMessage\": \"Error while processing request ID: CM-502adbb3-1c37-4cc6-bc9f-6777ad4227a3 -- Failed Processing; cause: Traceback (most recent call last):\\n File \\\"/opt/app/sniro/sniroapp/sniro/optimizers/cmopt/rcscheduler/local_opt_processor.py\\\", line 15, in process_local_cm_scheduler_opt\\n full_process_local_cm_scheduler_opt(request_json, policies, sniro_config)\\n File \\\"/opt/app/sniro/sniroapp/sniro/optimizers/cmopt/rcscheduler/local_opt_processor.py\\\", line 38, in full_process_local_cm_scheduler_opt\\n json_req = create_cm_scheduler_request(request_json, policies, all_req_info)\\n File \\\"/opt/app/sniro/sniroapp/sniro/optimizers/cmopt/rcscheduler/request_builder.py\\\", line 16, in create_cm_scheduler_request\\n cm = vertical_topology.VerticalConflicts(request_json) # TODO: rename + refactor\\n File \\\"/opt/app/sniro/sniroapp/sniro/datasources/aai/vertical_topology.py\\\", line 68, in __init__\\n self.tzinfo = dict((x, tzxref[self.clli[x]]) for x in self.vnfs)\\n File \\\"/opt/app/sniro/sniroapp/sniro/datasources/aai/vertical_topology.py\\\", line 68, in \\n self.tzinfo = dict((x, tzxref[self.clli[x]]) for x in self.vnfs)\\nKeyError: ('Zolson1MMSC04ee0f', '(Unable to get timezones for some elements)')\\n\"," + + " \"optimizerStatus\": \"failed\"," + + " \"optimizerAttemptsToSchedule\": 0," + + " \"optimizerReturnDateTime\": \"2018-06-06T13:13:47Z\"," + + " \"optimizerTransactionId\": \"645c4cfb-e00f-4995-bf23-a7df892eee0f\"," + + " \"scheduleId\": \"645c4cfb-e00f-4995-bf23-a7df892eee0f\"," + + " \"scheduleName\": \"645c4cfb-e00f-4995-bf23-a7df892eee0f\"," + + " \"status\": \"Optimization Failed\"," + + " \"userId\": \"jf9860\"," + + " \"domain\": \"ChangeManagement\"," + + " \"domainData\": [" + + " {" + + " \"id\": 17," + + " \"name\": \"CallbackData\"," + + " \"value\": \"{\\\"requestType\\\": \\\"Update\\\", \\\"requestDetails\\\": [{\\\"vnfInstanceId\\\": \\\"b8d99523-1e83-4fd1-b42f-849361ef7024\\\", \\\"relatedInstanceList\\\": [{\\\"relatedInstance\\\": {\\\"instanceId\\\": \\\"54ba3628-9ee5-4b32-8a2a-3abf001bed4e\\\", \\\"modelInfo\\\": {\\\"modelVersionId\\\": \\\"4ec07a2d-6bb5-4373-8ed6-4bc7ac1246fd\\\", \\\"modelVersion\\\": \\\"4.0\\\", \\\"modelName\\\": \\\"CHARLOTTE_2017_1011\\\", \\\"modelInvariantId\\\": \\\"e58733ef-43cb-4b6b-b641-922078b6c88b\\\", \\\"modelType\\\": \\\"service\\\"}}}], \\\"requestParameters\\\": {\\\"usePreload\\\": true}, \\\"requestInfo\\\": {\\\"source\\\": \\\"VID\\\", \\\"requestorId\\\": \\\"az2016\\\", \\\"suppressRollback\\\": false}, \\\"vnfName\\\": \\\"CHARLOTTE_2017_1011_oh22u_20171103\\\", \\\"modelInfo\\\": {\\\"modelVersionId\\\": \\\"4ec07a2d-6bb5-4373-8ed6-4bc7ac1246fd\\\", \\\"modelName\\\": \\\"CHARLOTTE_2017_1011_oh22u_20171103\\\", \\\"modelInvariantId\\\": \\\"93e16072-715a-42ef-9d0a-080052d6b716\\\", \\\"modelType\\\": \\\"vnf\\\", \\\"modelCustomizationId\\\": \\\"1779a999-ea17-4f31-98e9-75b6fbdd0acb\\\"}, \\\"cloudConfiguration\\\": {\\\"tenantId\\\": \\\"88a6ca3ee0394ade9403f075db23167e\\\", \\\"lcpCloudRegionId\\\": \\\"mdt1\\\"}}]}\"" + + " }," + + " {" + + " \"id\": 21," + + " \"name\": \"WorkflowName\"," + + " \"value\": \"Replace\"" + + " }," + + " {" + + " \"id\": 25," + + " \"name\": \"CallbackUrl\"," + + " \"value\": \"http://127.0.0.1:8900/scheduler/v1/loopbacktest/vid\"" + + " }" + + " ]," + + " \"scheduleApprovals\": []" + + " }," + + " \"schedulesId\": 0" + + " }" + + "]"; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceMetadataGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceMetadataGet.java index 9b1ea80af..00a47b7db 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceMetadataGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceMetadataGet.java @@ -1,12 +1,14 @@ package org.onap.simulator.presetGenerator.presets.sdc; import org.springframework.http.HttpMethod; +import vid.automation.test.infra.ModelInfo; -/** - * Created by itzikliderman on 21/12/2017. - */ public class PresetSDCGetServiceMetadataGet extends SdcPresetWithModelVersionId { + public PresetSDCGetServiceMetadataGet(ModelInfo modelInfo) { + this(modelInfo.modelVersionId, modelInfo.modelInvariantId, modelInfo.zipFileName); + } + public PresetSDCGetServiceMetadataGet(String modelVersionId, String modelInvariantId, String zipFileName) { super(modelVersionId); this.modelInvariantId = modelInvariantId; @@ -25,7 +27,7 @@ public class PresetSDCGetServiceMetadataGet extends SdcPresetWithModelVersionId " \"name\": \"action-data\"," + " \"version\": \"1.0\"," + " \"toscaModelURL\": \"./"+zipFileName+"\"," + - " \"category\": \"Mobility\"," + + " \"category\": \"Emanuel\"," + " \"lifecycleState\": \"CERTIFIED\"," + " \"lastUpdaterUserId\": \"rg276b\"," + " \"lastUpdaterFullName\": null," + diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGet.java index e243dc321..303f5a4e1 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGet.java @@ -1,14 +1,16 @@ package org.onap.simulator.presetGenerator.presets.sdc; import org.springframework.http.HttpMethod; +import vid.automation.test.infra.ModelInfo; -/** - * Created by itzikliderman on 21/12/2017. - */ public class PresetSDCGetServiceToscaModelGet extends SdcPresetWithModelVersionId { private String file; + public PresetSDCGetServiceToscaModelGet(ModelInfo modelInfo) { + this(modelInfo.modelVersionId, modelInfo.zipFileName); + } + public PresetSDCGetServiceToscaModelGet(String modelVersionId, String file) { super(modelVersionId); this.file = file; diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGetEmptyResult.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGetEmptyResult.java new file mode 100644 index 000000000..f6f67136e --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGetEmptyResult.java @@ -0,0 +1,24 @@ +package org.onap.simulator.presetGenerator.presets.sdc; + +import org.springframework.http.HttpMethod; + +public class PresetSDCGetServiceToscaModelGetEmptyResult extends SdcPresetWithModelVersionId { + + public PresetSDCGetServiceToscaModelGetEmptyResult(String modelVersionId) { + super(modelVersionId); + } + + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return super.getReqPath()+"/toscaModel"; + } + + @Override + public Object getResponseBody() { + return ""; + } +} diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGetInvalidResponse.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGetInvalidResponse.java new file mode 100644 index 000000000..7676062e5 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGetInvalidResponse.java @@ -0,0 +1,32 @@ +package org.onap.simulator.presetGenerator.presets.sdc; + +import org.springframework.http.HttpMethod; + +public class PresetSDCGetServiceToscaModelGetInvalidResponse extends SdcPresetWithModelVersionId { + + private final int httpCode; + + public PresetSDCGetServiceToscaModelGetInvalidResponse(String modelVersionId, int httpCode) { + super(modelVersionId); + this.httpCode = httpCode; + } + + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return super.getReqPath()+"/toscaModel"; + } + + @Override + public Object getResponseBody() { + return "simulated error description from sdc"; + } + + @Override + public int getResponseCode() { + return httpCode; + } +} -- cgit 1.2.3-korg