aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-03-13 12:44:01 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-13 12:44:01 +0000
commit6222fd0a63a76c7588ac7d096b8e630a6fd2343e (patch)
tree4f462cce4c17cd6225b08c4d6167b23ea55e1641 /mso-catalog-db
parent22c74e97c4d75249c7b15b4ba8862c6a4efdb84a (diff)
parentf99e4a56e6b9ec09ece48a7b111c9ec286220264 (diff)
Merge "add instance group support to SO"
Diffstat (limited to 'mso-catalog-db')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java1
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java1
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java13
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepository.java8
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java11
6 files changed, 34 insertions, 2 deletions
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<ControllerSelectionReference> controllerSelectionReferenceClient;
+ private final Client<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomizationClient;
+
private final Client<PnfResource> pnfResourceClient;
private final Client<PnfResourceCustomization> 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<VnfVfmoduleCvnfcConfigurationCustomization, Integer> {
List<VnfVfmoduleCvnfcConfigurationCustomization> 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