From f99e4a56e6b9ec09ece48a7b111c9ec286220264 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Sun, 10 Mar 2019 10:56:41 -0400 Subject: add instance group support to SO add create support add delete support added naming service support Change-Id: Iaf4f2bdae8ea55aca71d6e9b818a76e90db0b012 Issue-ID: SO-1616 Signed-off-by: Benjamin, Max (mb388a) --- .../org/onap/so/db/catalog/beans/OrchestrationAction.java | 2 ++ .../java/org/onap/so/db/catalog/beans/ResourceType.java | 1 + .../beans/VnfVfmoduleCvnfcConfigurationCustomization.java | 1 + .../java/org/onap/so/db/catalog/client/CatalogDbClient.java | 13 +++++++++++++ ...nfVfmoduleCvnfcConfigurationCustomizationRepository.java | 8 ++++++++ ...moduleCvnfcConfigurationCustomizationRepositoryTest.java | 11 +++++++++-- 6 files changed, 34 insertions(+), 2 deletions(-) (limited to 'mso-catalog-db/src') diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java index d831d1ebd2..1fd254f254 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java @@ -30,6 +30,8 @@ public enum OrchestrationAction { CREATE("Create"), DELETE("Delete"), UPDATE("Update"), + ADD_MEMBERS("AddMembers"), + REMOVE_MEMBERS("RemoveMembers"), CUSTOM("Custom"); private final String name; diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java index 64eff56f97..6d5c0fd9a8 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java @@ -28,6 +28,7 @@ public enum ResourceType { NETWORK("Network"), NETWORK_COLLECTION("NetworkCollection"), CONFIGURATION("Configuration"), + INSTANCE_GROUP("InstanceGroup"), NO_VALIDATE("NoValidate"); private final String name; diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java index f5e9b5f560..7ce657c5c7 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java @@ -213,6 +213,7 @@ public class VnfVfmoduleCvnfcConfigurationCustomization implements Serializable this.configurationResource = configurationResource; } + @LinkedResource public CvnfcCustomization getCvnfcCustomization() { return cvnfcCustomization; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java index b79ffedf83..9b888cb2ed 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java @@ -53,6 +53,7 @@ import org.onap.so.db.catalog.beans.VnfComponentsRecipe; import org.onap.so.db.catalog.beans.VnfRecipe; import org.onap.so.db.catalog.beans.VnfResource; import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization; import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization; import org.onap.so.db.catalog.beans.macro.NorthBoundRequest; import org.onap.so.db.catalog.beans.macro.OrchestrationFlow; @@ -231,6 +232,8 @@ public class CatalogDbClient { private final Client controllerSelectionReferenceClient; + private final Client vnfVfmoduleCvnfcConfigurationCustomizationClient; + private final Client pnfResourceClient; private final Client pnfResourceCustomizationClient; @@ -359,6 +362,7 @@ public class CatalogDbClient { cvnfcCustomizationClient = clientFactory.create(CvnfcCustomization.class); controllerSelectionReferenceClient = clientFactory.create(ControllerSelectionReference.class); externalServiceToInternalServiceClient = clientFactory.create(ExternalServiceToInternalService.class); + vnfVfmoduleCvnfcConfigurationCustomizationClient = clientFactory.create(VnfVfmoduleCvnfcConfigurationCustomization.class); pnfResourceClient = clientFactory.create(PnfResource.class); pnfResourceCustomizationClient = clientFactory.create(PnfResourceCustomization.class); } @@ -408,6 +412,7 @@ public class CatalogDbClient { cvnfcCustomizationClient = clientFactory.create(CvnfcCustomization.class); controllerSelectionReferenceClient = clientFactory.create(ControllerSelectionReference.class); externalServiceToInternalServiceClient = clientFactory.create(ExternalServiceToInternalService.class); + vnfVfmoduleCvnfcConfigurationCustomizationClient = clientFactory.create(VnfVfmoduleCvnfcConfigurationCustomization.class); pnfResourceClient = clientFactory.create(PnfResource.class); pnfResourceCustomizationClient = clientFactory.create(PnfResourceCustomization.class); } @@ -784,4 +789,12 @@ public class CatalogDbClient { .queryParam("VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID", vfModuleCustomizationUUID).build().toString())); } + public VnfVfmoduleCvnfcConfigurationCustomization getVnfVfmoduleCvnfcConfigurationCustomizationByVnfCustomizationUuidAndVfModuleCustomizationUuidAndCvnfcCustomizationUuid(String vnfCustomizationUuid, + String vfModuleCustomizationUuid, String cvnfcCustomizationUuid) { + return this.getSingleResource(vnfVfmoduleCvnfcConfigurationCustomizationClient, getUri(UriBuilder + .fromUri(endpoint + "/vnfVfmoduleCvnfcConfigurationCustomization/search/findOneByVnfResourceCustomizationAndVfModuleCustomizationAndCvnfcCustomization") + .queryParam("VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID", vnfCustomizationUuid) + .queryParam("VF_MODULE_MODEL_CUSTOMIZATION_UUID", vfModuleCustomizationUuid) + .queryParam("CVNFC_MODEL_CUSTOMIZATION_UUID", cvnfcCustomizationUuid).build().toString())); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepository.java index f936933485..aad75a15be 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepository.java @@ -24,9 +24,17 @@ import java.util.List; import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "vnfVfmoduleCvnfcConfigurationCustomization", path = "vnfVfmoduleCvnfcConfigurationCustomization") public interface VnfVfmoduleCvnfcConfigurationCustomizationRepository extends JpaRepository { List findByModelCustomizationUUID(String modelCustomizationUUID); + + @Query(value = "SELECT * FROM vnf_vfmodule_cvnfc_configuration_customization WHERE VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID = ?1 AND VF_MODULE_MODEL_CUSTOMIZATION_UUID = ?2 AND CVNFC_MODEL_CUSTOMIZATION_UUID = ?3", nativeQuery = true) + VnfVfmoduleCvnfcConfigurationCustomization findOneByVnfResourceCustomizationAndVfModuleCustomizationAndCvnfcCustomization ( + @Param("VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID") String vnfResourceCustomizationUuid, + @Param("VF_MODULE_MODEL_CUSTOMIZATION_UUID") String vfModuleCustomizationUuid, + @Param("CVNFC_MODEL_CUSTOMIZATION_UUID") String cvnfcCustomizationUuid); } \ No newline at end of file diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java index 6f0e3020b1..a953fc8a3c 100644 --- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java +++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java @@ -81,7 +81,7 @@ public class VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest extends Ba vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationResource(configurationResource); CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization(); - cvnfcCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459"); + cvnfcCustomization.setModelCustomizationUUID("0c3a8b76-3f5b-11e9-b210-d663bd873d93"); VfModuleCustomization vfModuleCustomization = new VfModuleCustomization(); vfModuleCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459"); @@ -122,5 +122,12 @@ public class VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest extends Ba if(foundVnfVfmoduleCvnfcConfigurationCustomization == null) fail("should not be null"); + + VnfVfmoduleCvnfcConfigurationCustomization foundOneVnfVfmoduleCvnfcConfigurationCustomization = + vnfVfmoduleCvnfcConfigurationCustomizationRepository.findOneByVnfResourceCustomizationAndVfModuleCustomizationAndCvnfcCustomization("cf9f6efc-9f14-11e8-98d0-529269fb1459", "cf9f6efc-9f14-11e8-98d0-529269fb1459", "0c3a8b76-3f5b-11e9-b210-d663bd873d93"); + + if(foundOneVnfVfmoduleCvnfcConfigurationCustomization == null) + fail("should not be null"); + Assert.assertTrue(foundOneVnfVfmoduleCvnfcConfigurationCustomization.getConfigurationFunction().equalsIgnoreCase("testConfigurationFunction")); } -} +} \ No newline at end of file -- cgit 1.2.3-korg