diff options
40 files changed, 681 insertions, 201 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql index e5daf24d6c..e27ec2ef27 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql @@ -624,7 +624,17 @@ VALUES ('VOLUME_GROUP', 'PENDING', 'DELETE', 'SILENT_SUCCESS'), ('VF_MODULE', 'PENDING', 'DELETE', 'FAIL'), -('NETWORK', 'PENDING', 'DELETE', 'FAIL'); +('NETWORK', 'PENDING', 'DELETE', 'FAIL'), + +('VNF', 'CONFIGURED', 'ACTIVATE', 'CONTINUE'), +('VNF', 'CONFIGURED', 'UNASSIGN', 'CONTINUE'), +('VNF', 'CONFIGURED', 'DESACTIVATE', 'SILENT_SUCCESS'), + +('VNF', 'CONFIGURE', 'UNASSIGN', 'CONTINUE'), +('VNF', 'CONFIGURE', 'DESACTIVATE', 'SILENT_SUCCESS'), + +('VNF', 'CONFIGASSIGNED', 'UNASSIGN', 'CONTINUE'), +('VNF', 'CONFIGASSIGNED', 'DESACTIVATE', 'SILENT_SUCCESS'); UPDATE orchestration_flow_reference SET FLOW_NAME = 'HomingBB' WHERE FLOW_NAME = 'SniroHoming'; @@ -799,7 +809,8 @@ VALUES ('CONFIGURATION', 'PENDING CREATE', 'DEACTIVATE', 'FAIL'), ('CONFIGURATION', 'PENDING DELETE', 'DEACTIVATE', 'FAIL'), ('CONFIGURATION', 'PENDING ACTIVATION', 'DEACTIVATE', 'FAIL'), -('CONFIGURATION', 'PENDING', 'DEACTIVATE', 'FAIL'); +('CONFIGURATION', 'PENDING', 'DEACTIVATE', 'FAIL'), +('VNF','CONFIGDEPLOYED','ACTIVATE','CONTINUE'); UPDATE orchestration_flow_reference SET SEQ_NO = SEQ_NO + 2 WHERE COMPOSITE_ACTION = 'Service-Macro-Create' AND SEQ_NO > 12; @@ -867,7 +878,8 @@ UPDATE northbound_request_ref_lookup SET SERVICE_TYPE = '*' WHERE SERVICE_TYPE I INSERT INTO building_block_detail(BUILDING_BLOCK_NAME, RESOURCE_TYPE, TARGET_ACTION) VALUES ('ConfigAssignVnfBB', 'NO_VALIDATE', 'CUSTOM'), -('ConfigDeployVnfBB', 'NO_VALIDATE', 'CUSTOM'); +('ConfigDeployVnfBB', 'NO_VALIDATE', 'CUSTOM'), +('ControllerExecutionBB', 'NO_VALIDATE', 'CUSTOM'); UPDATE rainy_day_handler_macro SET reg_ex_error_message = '*' WHERE reg_ex_error_message IS null; @@ -902,3 +914,4 @@ VALUES ('SDNOVnfHealthCheckBB','*','*','*','*','Manual','Abort','*', '*'), ('VNFUnsetInMaintFlagActivity','*','*','*','*','Manual','Abort','*', '*'), ('VNFUnsetClosedLoopDisabledActivity','*','*','*','*','Manual','Abort','*', '*'); + diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.7__Update_Optical_Service_Recipe.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.7__Update_Optical_Service_Recipe.sql new file mode 100644 index 0000000000..e97df04ef6 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.7__Update_Optical_Service_Recipe.sql @@ -0,0 +1,6 @@ +use catalogdb; + +INSERT INTO `vnf_recipe` (`id`, `VF_MODULE_ID`, `ACTION`, `SERVICE_TYPE`, `VERSION_STR`, `NF_ROLE`, `DESCRIPTION`, `ORCHESTRATION_URI`, `VNF_PARAM_XSD`, `RECIPE_TIMEOUT`, `CREATION_TIMESTAMP`) VALUES (15,NULL,'createInstance',NULL,'2.0','UNI-UNI','OTN UNI-UNI resource create recipe','/mso/async/services/CreateSDNCNetworkResource',NULL,180,'2017-10-05 18:52:03'); +INSERT INTO `vnf_recipe` (`id`, `VF_MODULE_ID`, `ACTION`, `SERVICE_TYPE`, `VERSION_STR`, `NF_ROLE`, `DESCRIPTION`, `ORCHESTRATION_URI`, `VNF_PARAM_XSD`, `RECIPE_TIMEOUT`, `CREATION_TIMESTAMP`) VALUES (16,NULL,'deleteInstance',NULL,'2.0','UNI-UNI','OTN UNI-UNI resource delete recipe','/mso/async/services/DeleteSDNCNetworkResource',NULL,180,'2017-10-05 18:52:03'); +INSERT INTO `vnf_recipe` (`id`, `VF_MODULE_ID`, `ACTION`, `SERVICE_TYPE`, `VERSION_STR`, `NF_ROLE`, `DESCRIPTION`, `ORCHESTRATION_URI`, `VNF_PARAM_XSD`, `RECIPE_TIMEOUT`, `CREATION_TIMESTAMP`) VALUES (17,NULL,'createInstance',NULL,'2.0','UNI-ENNI','OTN UNI-ENNI resource create recipe','/mso/async/services/CreateSDNCNetworkResource',NULL,180,'2017-10-05 18:52:03'); +INSERT INTO `vnf_recipe` (`id`, `VF_MODULE_ID`, `ACTION`, `SERVICE_TYPE`, `VERSION_STR`, `NF_ROLE`, `DESCRIPTION`, `ORCHESTRATION_URI`, `VNF_PARAM_XSD`, `RECIPE_TIMEOUT`, `CREATION_TIMESTAMP`) VALUES (18,NULL,'deleteInstance',NULL,'2.0','UNI-ENNI','OTN UNI-ENNI resource delete recipe','/mso/async/services/DeleteSDNCNetworkResource',NULL,180,'2017-10-05 18:52:03'); diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V9.0__AddConfiguredForVnfOrchestrationStatus.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V9.0__AddConfiguredForVnfOrchestrationStatus.sql deleted file mode 100644 index 81e6092f5f..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V9.0__AddConfiguredForVnfOrchestrationStatus.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE) -VALUES ('VNF', 'CONFIGURED', 'ACTIVATE', 'CONTINUE'); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java index 6d3b0ab680..e83ec8387a 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java @@ -278,6 +278,9 @@ public class HeatBridgeImpl implements HeatBridgeApi { @Override public void createPserversAndPinterfacesIfNotPresentInAai(final List<Resource> stackResources) throws HeatBridgeException { + if (stackResources == null) { + return; + } Map<String, Pserver> serverHostnames = getPserverMapping(stackResources); createPServerIfNotExists(serverHostnames); List<String> portIds = @@ -294,8 +297,13 @@ public class HeatBridgeImpl implements HeatBridgeApi { private Map<String, Pserver> getPserverMapping(final List<Resource> stackResources) { List<Server> osServers = getAllOpenstackServers(stackResources); Map<String, Pserver> pserverMap = new HashMap<>(); - for (Server server : osServers) { - pserverMap.put(server.getHost(), aaiHelper.buildPserver(server)); + if (osServers != null) { + for (Server server : osServers) { + Pserver pserver = aaiHelper.buildPserver(server); + if (pserver != null) { + pserverMap.put(server.getHost(), pserver); + } + } } return pserverMap; } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java index adcde92917..727cdccff5 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java @@ -146,6 +146,9 @@ public class AaiHelper { * @return AAI Pserver object */ public Pserver buildPserver(final Server server) { + if (server == null || server.getHypervisorHostname() == null) { + return null; + } Pserver pserver = new Pserver(); pserver.setInMaint(false); pserver.setHostname(server.getHypervisorHostname()); diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java index 84ff054a7c..7feaa9c4c3 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java @@ -27,6 +27,7 @@ import javax.xml.bind.annotation.XmlElement; import org.onap.so.adapters.requestsdb.exceptions.MsoRequestsDbException; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.beans.InstanceNfvoMapping; +import org.onap.so.db.request.beans.OperationStatus; import org.onap.so.db.request.beans.ResourceOperationStatus; /** @@ -77,6 +78,12 @@ public interface MsoRequestsDbAdapter { public boolean getSiteStatus(@WebParam(name = "siteName") @XmlElement(required = true) String siteName); @WebMethod + public OperationStatus getServiceOperationStatus( + @WebParam(name = "serviceId") @XmlElement(required = true) String serviceId, + @WebParam(name = "operationId") @XmlElement(required = false) String operationId) + throws MsoRequestsDbException; + + @WebMethod public void updateServiceOperationStatus( @WebParam(name = "serviceId") @XmlElement(required = true) String serviceId, @WebParam(name = "operationId") @XmlElement(required = false) String operationId, diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java index b262cb21cb..8782cce34a 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java @@ -222,6 +222,27 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { } /** + * get the operation status + * + * @param serviceId + * @param operationId + * @return operationStatus + * @throws MsoRequestsDbException + */ + @Override + @Transactional + public OperationStatus getServiceOperationStatus(String serviceId, String operationId) + throws MsoRequestsDbException { + OperationStatus operationStatus; + if (operationId.isEmpty()) { + operationStatus = operationStatusRepository.findOneByServiceId(serviceId); + } else { + operationStatus = operationStatusRepository.findOneByServiceIdAndOperationId(serviceId, operationId); + } + return operationStatus; + } + + /** * update operation status <br> * * @param serviceId diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml index 54f05859d9..093dab3fd2 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml +++ b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml @@ -66,6 +66,7 @@ <withXml>true</withXml> <useRxJava2>true</useRxJava2> <serializableModel>true</serializableModel> + <dateLibrary>java8-localdatetime</dateLibrary> </configOptions> </configuration> </execution> @@ -86,6 +87,7 @@ <withXml>true</withXml> <useRxJava2>true</useRxJava2> <serializableModel>true</serializableModel> + <dateLibrary>java8-localdatetime</dateLibrary> </configOptions> </configuration> </execution> diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java index bb2730bd2b..e3166447e6 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java @@ -56,8 +56,8 @@ public class MessageConverterConfiguration { final DefaultConversionService service = new DefaultConversionService(); service.addConverter(new VnfPkgInfoConverter(vnfmAdapterUrlProvider)); service.addConverter(new PkgmSubscriptionRequestConverter()); - service.addConverter(new PkgChangeNotificationConverter()); - service.addConverter(new PkgOnboardingNotificationConverter()); + service.addConverter(new PkgChangeNotificationConverter(vnfmAdapterUrlProvider)); + service.addConverter(new PkgOnboardingNotificationConverter(vnfmAdapterUrlProvider)); return service; } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java index e1c43098f8..b8a6fb9560 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java @@ -20,6 +20,7 @@ package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; +import org.onap.so.adapters.vnfmadapter.VnfmAdapterUrlProvider; import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgmLinks; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinks; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage; @@ -30,20 +31,26 @@ import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notifi * * @author andrew.a.lamb@est.tech */ -abstract public class AbstractPkgNotificationConverter { +public abstract class AbstractPkgNotificationConverter { + + private final VnfmAdapterUrlProvider vnfmAdapterUrlProvider; + + public AbstractPkgNotificationConverter(final VnfmAdapterUrlProvider vnfmAdapterUrlProvider) { + this.vnfmAdapterUrlProvider = vnfmAdapterUrlProvider; + } protected URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinks convert( - final PkgmLinks pkgmLinks) { + final PkgmLinks pkgmLinks, final String vnfPkgId, final String subscriptionId) { final URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage linksVnfPackage = new URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage(); if (pkgmLinks.getVnfPackage() != null) { - linksVnfPackage.setHref(pkgmLinks.getVnfPackage().getHref()); + linksVnfPackage.setHref(vnfmAdapterUrlProvider.getVnfPackageUrl(vnfPkgId)); } final URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage linksSubscription = new URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage(); if (pkgmLinks.getSubscription() != null) { - linksSubscription.setHref(pkgmLinks.getSubscription().getHref()); + linksSubscription.setHref(vnfmAdapterUrlProvider.getSubscriptionUriString(subscriptionId)); } final URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinks links = diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java index 8c4168632b..055f96b8a2 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java @@ -21,6 +21,7 @@ package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; import static org.slf4j.LoggerFactory.getLogger; +import org.onap.so.adapters.vnfmadapter.VnfmAdapterUrlProvider; import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgChangeNotification; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageChangeNotification; import org.slf4j.Logger; @@ -38,6 +39,11 @@ public class PkgChangeNotificationConverter extends AbstractPkgNotificationConve implements Converter<PkgChangeNotification, VnfPackageChangeNotification> { private static final Logger logger = getLogger(PkgChangeNotificationConverter.class); + + public PkgChangeNotificationConverter(final VnfmAdapterUrlProvider vnfmAdapterUrlProvider) { + super(vnfmAdapterUrlProvider); + } + /** * Convert a {@link PkgChangeNotification} Object to an {@link VnfPackageChangeNotification} Object * @@ -71,9 +77,11 @@ public class PkgChangeNotificationConverter extends AbstractPkgNotificationConve .fromValue(pkgChangeNotification.getOperationalState().getValue())); } - vnfPackageChangeNotification.setLinks(convert((pkgChangeNotification.getLinks()))); + vnfPackageChangeNotification.setLinks(convert(pkgChangeNotification.getLinks(), + pkgChangeNotification.getVnfPkgId(), pkgChangeNotification.getSubscriptionId())); return vnfPackageChangeNotification; } + } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java index 836acb6d36..50f95c6353 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java @@ -21,6 +21,7 @@ package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; import static org.slf4j.LoggerFactory.getLogger; +import org.onap.so.adapters.vnfmadapter.VnfmAdapterUrlProvider; import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgOnboardingNotification; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; import org.slf4j.Logger; @@ -38,6 +39,10 @@ public class PkgOnboardingNotificationConverter extends AbstractPkgNotificationC implements Converter<PkgOnboardingNotification, VnfPackageOnboardingNotification> { private static final Logger logger = getLogger(PkgOnboardingNotificationConverter.class); + public PkgOnboardingNotificationConverter(final VnfmAdapterUrlProvider vnfmAdapterUrlProvider) { + super(vnfmAdapterUrlProvider); + } + /** * Convert a {@link PkgOnboardingNotification} Object to an {@link VnfPackageOnboardingNotification} Object * @@ -61,7 +66,8 @@ public class PkgOnboardingNotificationConverter extends AbstractPkgNotificationC vnfPackageOnboardingNotification.setVnfPkgId(pkgOnboardingNotification.getVnfPkgId()); vnfPackageOnboardingNotification.setVnfdId(pkgOnboardingNotification.getVnfdId()); - vnfPackageOnboardingNotification.setLinks(convert((pkgOnboardingNotification.getLinks()))); + vnfPackageOnboardingNotification.setLinks(convert(pkgOnboardingNotification.getLinks(), + pkgOnboardingNotification.getVnfPkgId(), pkgOnboardingNotification.getSubscriptionId())); return vnfPackageOnboardingNotification; } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java index 8f6d853997..2e99658400 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java @@ -20,13 +20,16 @@ package org.onap.so.adapters.vnfmadapter.extclients; +import java.time.LocalDateTime; import com.google.gson.Gson; import java.util.Iterator; -import org.onap.vnfmadapter.v1.JSON; +import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.JSON; +import org.onap.so.adapters.vnfmadapter.rest.EtsiSubscriptionNotificationController; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.GsonHttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.client.RestTemplate; +import org.threeten.bp.OffsetDateTime; /** * A base class that can be extended by classes for configuring HttpRestServiceProvider classes. Provides common methods @@ -35,6 +38,7 @@ import org.springframework.web.client.RestTemplate; * @author gareth.roper@est.tech */ public abstract class AbstractServiceProviderConfiguration { + private final JSON.OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new JSON.OffsetDateTimeTypeAdapter(); public void setGsonMessageConverter(final RestTemplate restTemplate) { final Iterator<HttpMessageConverter<?>> iterator = restTemplate.getMessageConverters().iterator(); @@ -43,7 +47,10 @@ public abstract class AbstractServiceProviderConfiguration { iterator.remove(); } } - final Gson gson = new JSON().getGson(); + final Gson gson = JSON.createGson().registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) + .registerTypeAdapter(LocalDateTime.class, + new EtsiSubscriptionNotificationController.LocalDateTimeTypeAdapter()) + .create(); restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson)); } } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java index c065203cd8..c30c74daf8 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java @@ -45,6 +45,7 @@ public class OAuthNotificationServiceProvider extends AbstractNotificationServic public boolean send(final Object notification, final SubscriptionsAuthentication subscriptionsAuthentication, final String callbackUri) { logger.info("Sending notification to uri: {}", callbackUri); + logger.info("Object: {}", notification); final String token = getAccessToken(subscriptionsAuthentication); if (token == null) { diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationController.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationController.java index a97f04bcc8..92176215bf 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationController.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationController.java @@ -20,11 +20,13 @@ package org.onap.so.adapters.vnfmadapter.rest; -import static org.onap.so.adapters.vnfmadapter.Constants.ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL; -import static org.slf4j.LoggerFactory.getLogger; -import java.util.AbstractMap; -import java.util.Map.Entry; -import javax.ws.rs.core.MediaType; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgChangeNotification; import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgOnboardingNotification; import org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.NotificationManager; @@ -38,10 +40,14 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; +import javax.ws.rs.core.MediaType; +import java.io.IOException; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.AbstractMap; +import java.util.Map.Entry; +import static org.onap.so.adapters.vnfmadapter.Constants.ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL; +import static org.slf4j.LoggerFactory.getLogger; /** * This controller handles the ETSI Subscription Notification Endpoints. @@ -61,7 +67,7 @@ public class EtsiSubscriptionNotificationController { @Autowired public EtsiSubscriptionNotificationController(final NotificationManager notificationManager) { this.notificationManager = notificationManager; - this.gson = new GsonBuilder().create(); + this.gson = new GsonBuilder().registerTypeAdapter(LocalDateTime.class, new LocalDateTimeTypeAdapter()).create(); } @GetMapping(value = "/notification") @@ -77,10 +83,11 @@ public class EtsiSubscriptionNotificationController { * @return Response Code: 204 No Content if Successful, ProblemDetails Object if not. */ @PostMapping(value = "/notification", consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) - public ResponseEntity<?> postSubscriptionNotification(@RequestBody final String notification) { - logger.info("Posting subscription notification \n{}", notification); + public ResponseEntity<?> postSubscriptionNotification(@RequestBody final Object notification) { + logger.info("Posting subscription notification class: {} \n{}", notification.getClass(), notification); + final String notificationString = gson.toJson(notification); - final Entry<String, Object> notificationObject = getNotificationObject(notification); + final Entry<String, Object> notificationObject = getNotificationObject(notificationString); if (notificationManager.processSubscriptionNotification(notificationObject.getValue(), notificationObject.getKey())) { logger.info("Notification Delivered Successfully"); @@ -92,6 +99,7 @@ public class EtsiSubscriptionNotificationController { } private Entry<String, Object> getNotificationObject(final String notification) { + logger.info("getNotificationObject() notification: {}", notification); final String notificationType = getNotificationType(notification); if (PkgOnboardingNotification.NotificationTypeEnum.VNFPACKAGEONBOARDINGNOTIFICATION.getValue() .equals(notificationType)) { @@ -118,6 +126,7 @@ public class EtsiSubscriptionNotificationController { private String getNotificationType(final String notification) { try { + logger.info("getNotificationType() notification: {}", notification); final JsonParser parser = new JsonParser(); final JsonObject element = (JsonObject) parser.parse(notification); return element.get("notificationType").getAsString(); @@ -128,4 +137,30 @@ public class EtsiSubscriptionNotificationController { "Unable to parse notification type in object \n" + notification); } + public static class LocalDateTimeTypeAdapter extends TypeAdapter<LocalDateTime> { + + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + + @Override + public void write(final JsonWriter out, final LocalDateTime localDateTime) throws IOException { + if (localDateTime == null) { + out.nullValue(); + } else { + out.value(FORMATTER.format(localDateTime)); + } + } + + @Override + public LocalDateTime read(final JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + final String dateTime = in.nextString(); + return LocalDateTime.parse(dateTime, FORMATTER); + } + } + } + } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java index 29afa8c549..069bfac032 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java @@ -43,6 +43,7 @@ import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.mode import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgChangeNotification; import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgOnboardingNotification; import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgmLinks; +import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.JSON; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthenticationParamsBasic; @@ -54,18 +55,18 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.http.*; +import org.springframework.http.converter.json.GsonHttpMessageConverter; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.client.MockRestServiceServer; import org.springframework.web.client.RestTemplate; -import org.threeten.bp.LocalDateTime; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneOffset; +import java.time.LocalDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -95,13 +96,18 @@ public class EtsiSubscriptionNotificationControllerTest { private static final String EXPECTED_OAUTH_AUTHORIZATION = "Bearer " + TOKEN; private static final String NOTIFICATION_ID = "NOTIFICATION_ID"; private static final String SUBSCRIPTION_ID = "SUBSCRIPTION_ID"; - private static final OffsetDateTime TIMESTAMP = - OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 1, 1, 1, 1), ZoneOffset.ofHours(1)); + private static final String TIME_STAMP_STRING_EXPECTED_FROM_ETSI_CATALOG = "2020-01-01 01:01:01"; + private static final java.time.LocalDateTime TIMESTAMP = java.time.LocalDateTime.of(2020, 1, 1, 1, 1, 1, 1); private static final String VNFPKG_ID = UUID.randomUUID().toString(); private static final String VNFD_ID = UUID.randomUUID().toString(); + private static final String EXPECTED_VNF_PACKAGE_HREF = + "https://so-vnfm-adapter.onap:30406/so/vnfm-adapter/v1/vnfpkgm/v1/vnf_packages/" + VNFPKG_ID; + private static final String EXPECTED_SUBSCRIPTION_HREF = + "https://so-vnfm-adapter.onap:30406/so/vnfm-adapter/v1/vnfpkgm/v1/subscriptions/" + SUBSCRIPTION_ID; private BasicHttpHeadersProvider basicHttpHeadersProvider; - private final Gson gson = new GsonBuilder().create();; + private final Gson gson = new GsonBuilder().registerTypeAdapter(LocalDateTime.class, + new EtsiSubscriptionNotificationController.LocalDateTimeTypeAdapter()).create(); @Autowired @Qualifier(CONFIGURABLE_REST_TEMPLATE) @@ -121,6 +127,11 @@ public class EtsiSubscriptionNotificationControllerTest { basicHttpHeadersProvider = new BasicHttpHeadersProvider(); cache = cacheServiceProvider.getCache(Constants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE); cache.clear(); + + final Gson gson = JSON.createGson().registerTypeAdapter(LocalDateTime.class, + new EtsiSubscriptionNotificationController.LocalDateTimeTypeAdapter()).create(); + testRestTemplate = new TestRestTemplate( + new RestTemplateBuilder().additionalMessageConverters(new GsonHttpMessageConverter(gson))); } @After @@ -140,7 +151,6 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(jsonPath("$.id").value(NOTIFICATION_ID)) @@ -148,13 +158,13 @@ public class EtsiSubscriptionNotificationControllerTest { .value(VnfPackageOnboardingNotification.NotificationTypeEnum.VNFPACKAGEONBOARDINGNOTIFICATION .toString())) .andExpect(jsonPath("$.subscriptionId").value(SUBSCRIPTION_ID)) - .andExpect(jsonPath("$.timeStamp").value(TIMESTAMP.toString())) - .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID.toString())) - .andExpect(jsonPath("$.vnfdId").value(VNFD_ID.toString())) - .andExpect(jsonPath("$._links").value(buildPkgmLinks())) + .andExpect(jsonPath("$.timeStamp").value(TIME_STAMP_STRING_EXPECTED_FROM_ETSI_CATALOG)) + .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID)).andExpect(jsonPath("$.vnfdId").value(VNFD_ID)) + .andExpect(jsonPath("$._links") + .value(buildPkgmLinks(EXPECTED_VNF_PACKAGE_HREF, EXPECTED_SUBSCRIPTION_HREF))) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)).andRespond(withSuccess()); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); } @@ -162,8 +172,7 @@ public class EtsiSubscriptionNotificationControllerTest { @Test public void testOnboardingNotificationNotSentOnToVnfmCallbackUri_SubscriptionRequestNotInCache_Fail() { final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -181,12 +190,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.BAD_REQUEST)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -204,12 +212,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.MOVED_PERMANENTLY)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -226,12 +233,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.NOT_FOUND)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -249,12 +255,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -273,24 +278,23 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(jsonPath("$.id").value(NOTIFICATION_ID)) .andExpect(jsonPath("$.notificationType").value( VnfPackageChangeNotification.NotificationTypeEnum.VNFPACKAGECHANGENOTIFICATION.getValue())) .andExpect(jsonPath("$.subscriptionId").value(SUBSCRIPTION_ID)) - .andExpect(jsonPath("$.timeStamp").value(TIMESTAMP.toString())) - .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID.toString())) - .andExpect(jsonPath("$.vnfdId").value(VNFD_ID.toString())) + .andExpect(jsonPath("$.timeStamp").value(TIME_STAMP_STRING_EXPECTED_FROM_ETSI_CATALOG)) + .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID)).andExpect(jsonPath("$.vnfdId").value(VNFD_ID)) .andExpect( jsonPath("$.changeType").value(PkgChangeNotification.ChangeTypeEnum.OP_STATE_CHANGE.toString())) .andExpect(jsonPath("$.operationalState") .value(PkgChangeNotification.OperationalStateEnum.ENABLED.toString())) - .andExpect(jsonPath("$._links").value(buildPkgmLinks())) + .andExpect(jsonPath("$._links") + .value(buildPkgmLinks(EXPECTED_VNF_PACKAGE_HREF, EXPECTED_SUBSCRIPTION_HREF))) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)).andRespond(withSuccess()); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); } @@ -298,8 +302,7 @@ public class EtsiSubscriptionNotificationControllerTest { @Test public void testChangeNotificationNotSentOnToVnfmCallbackUri_SubscriptionRequestNotInCache_Fail() { final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -317,12 +320,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.BAD_REQUEST)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -340,12 +342,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.NOT_FOUND)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -363,12 +364,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -387,7 +387,6 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(jsonPath("$.id").value(NOTIFICATION_ID)) @@ -395,13 +394,13 @@ public class EtsiSubscriptionNotificationControllerTest { .value(VnfPackageOnboardingNotification.NotificationTypeEnum.VNFPACKAGEONBOARDINGNOTIFICATION .toString())) .andExpect(jsonPath("$.subscriptionId").value(SUBSCRIPTION_ID)) - .andExpect(jsonPath("$.timeStamp").value(TIMESTAMP.toString())) - .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID.toString())) - .andExpect(jsonPath("$.vnfdId").value(VNFD_ID.toString())) - .andExpect(jsonPath("$._links").value(buildPkgmLinks())) + .andExpect(jsonPath("$.timeStamp").value(TIME_STAMP_STRING_EXPECTED_FROM_ETSI_CATALOG)) + .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID)).andExpect(jsonPath("$.vnfdId").value(VNFD_ID)) + .andExpect(jsonPath("$._links") + .value(buildPkgmLinks(EXPECTED_VNF_PACKAGE_HREF, EXPECTED_SUBSCRIPTION_HREF))) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)).andRespond(withSuccess()); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); } @@ -412,13 +411,12 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)) .andRespond(withStatus(HttpStatus.UNAUTHORIZED)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -436,7 +434,6 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.OAUTH2_CLIENT_CREDENTIALS); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(TOKEN_ENDPOINT)).andExpect(method(HttpMethod.POST)) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)) @@ -448,16 +445,17 @@ public class EtsiSubscriptionNotificationControllerTest { .andExpect(jsonPath("$.notificationType").value( VnfPackageChangeNotification.NotificationTypeEnum.VNFPACKAGECHANGENOTIFICATION.toString())) .andExpect(jsonPath("$.subscriptionId").value(SUBSCRIPTION_ID)) - .andExpect(jsonPath("$.timeStamp").value(TIMESTAMP.toString())) - .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID.toString())) - .andExpect(jsonPath("$.vnfdId").value(VNFD_ID.toString())) + .andExpect(jsonPath("$.timeStamp").value(TIME_STAMP_STRING_EXPECTED_FROM_ETSI_CATALOG)) + .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID)).andExpect(jsonPath("$.vnfdId").value(VNFD_ID)) .andExpect( jsonPath("$.changeType").value(PkgChangeNotification.ChangeTypeEnum.OP_STATE_CHANGE.toString())) .andExpect(jsonPath("$.operationalState") .value(PkgChangeNotification.OperationalStateEnum.ENABLED.toString())) - .andExpect(jsonPath("$._links").value(buildPkgmLinks())).andRespond(withSuccess()); + .andExpect(jsonPath("$._links") + .value(buildPkgmLinks(EXPECTED_VNF_PACKAGE_HREF, EXPECTED_SUBSCRIPTION_HREF))) + .andRespond(withSuccess()); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); } @@ -468,12 +466,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.OAUTH2_CLIENT_CREDENTIALS); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServer.expect(requestTo(TOKEN_ENDPOINT)).andExpect(method(HttpMethod.POST)) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)).andRespond(withSuccess()); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -490,9 +487,8 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.TLS_CERT); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -532,17 +528,12 @@ public class EtsiSubscriptionNotificationControllerTest { } private PkgmLinks buildPkgmLinks() { - final PkgmLinks pkgmLinks = new PkgmLinks(); - - final NOTIFICATIONLINKSERIALIZER subscriptionLinkSerializer = new NOTIFICATIONLINKSERIALIZER(); - subscriptionLinkSerializer.setHref("subscription_href"); - pkgmLinks.setSubscription(subscriptionLinkSerializer); - - final NOTIFICATIONLINKSERIALIZER vnfPackageLinkSerializer = new NOTIFICATIONLINKSERIALIZER(); - vnfPackageLinkSerializer.setHref("vnf_package_href"); - pkgmLinks.setVnfPackage(vnfPackageLinkSerializer); + return buildPkgmLinks("vnf_package_href", "subscription_href"); + } - return pkgmLinks; + private PkgmLinks buildPkgmLinks(final String vnfPkgHref, final String subscriptionHref) { + return new PkgmLinks().vnfPackage(new NOTIFICATIONLINKSERIALIZER().href(vnfPkgHref)) + .subscription(new NOTIFICATIONLINKSERIALIZER().href(subscriptionHref)); } private PkgmSubscriptionRequest buildPkgmSubscriptionRequest( diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/PayloadConstants.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/PayloadConstants.java index 808d427d65..2812de799d 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/PayloadConstants.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/PayloadConstants.java @@ -6,6 +6,8 @@ * ================================================================================ * Modifications Copyright (C) 2020 Nordix * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -36,7 +38,7 @@ public final class PayloadConstants { public static final String SEPARATOR = "-"; public static final String PNF_SCOPE = "pnf"; public static final String VNF_SCOPE = "vnf"; - public static final String VF_MODULE_SCOPE = "vfModule"; + public static final String VF_MODULE_SCOPE = "vfmodule"; public static final String SERVICE_SCOPE = "service"; public static final String RESOLUTION_KEY = "resolution-key"; public static final String CDS_ACTOR = "cds"; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VfModuleCDSRequestProvider.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VfModuleCDSRequestProvider.java index bba8925f21..4b35371594 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VfModuleCDSRequestProvider.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VfModuleCDSRequestProvider.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2019 Bell Canada * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -81,8 +83,8 @@ public class VfModuleCDSRequestProvider implements CDSRequestProvider { final String modelCustomizationUuidForVnf = genericVnf.getModelInfoGenericVnf().getModelCustomizationUuid(); - blueprintName = genericVnf.getBlueprintName(); - blueprintVersion = genericVnf.getBlueprintVersion(); + blueprintName = genericVnf.getModelInfoGenericVnf().getBlueprintName(); + blueprintVersion = genericVnf.getModelInfoGenericVnf().getBlueprintVersion(); VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); vfModuleName = vfModule.getVfModuleName(); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VnfCDSRequestProvider.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VnfCDSRequestProvider.java index d33976d229..7425d09721 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VnfCDSRequestProvider.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VnfCDSRequestProvider.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2019 Bell Canada * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -79,8 +81,8 @@ public class VnfCDSRequestProvider implements CDSRequestProvider { final String modelCustomizationUuid = genericVnf.getModelInfoGenericVnf().getModelCustomizationUuid(); resolutionKey = genericVnf.getVnfName(); - blueprintName = genericVnf.getBlueprintName(); - blueprintVersion = genericVnf.getBlueprintVersion(); + blueprintName = genericVnf.getModelInfoGenericVnf().getBlueprintName(); + blueprintVersion = genericVnf.getModelInfoGenericVnf().getBlueprintVersion(); vnfObject.addProperty("service-instance-id", serviceInstance.getServiceInstanceId()); vnfObject.addProperty("service-model-uuid", serviceInstance.getModelInfoServiceInstance().getModelUuid()); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/GeneratePayloadForCdsTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/GeneratePayloadForCdsTest.java index 998976589c..20bd765338 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/GeneratePayloadForCdsTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/GeneratePayloadForCdsTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2019 Bell Canada. * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -52,7 +54,7 @@ public class GeneratePayloadForCdsTest { private static final String VNF_SCOPE = "vnf"; private static final String SERVICE_SCOPE = "service"; private static final String SERVICE_ACTION = "create"; - private static final String VF_SCOPE = "vfModule"; + private static final String VF_SCOPE = "vfmodule"; private static final String ASSIGN_ACTION = "configAssign"; private static final String DEPLOY_ACTION = "configDeploy"; private static final String DOWNLOAD_ACTION = "downloadNESw"; diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn index f12a3d241f..836950e9be 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1ahlzqg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.14.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1ahlzqg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0"> <bpmn:process id="ControllerExecutionBB" name="ControllerExecutionBB" isExecutable="true"> <bpmn:startEvent id="StartEvent_1"> <bpmn:outgoing>SequenceFlow_0gmfit3</bpmn:outgoing> @@ -10,30 +10,20 @@ <bpmn:incoming>SequenceFlow_0no1qag</bpmn:incoming> </bpmn:endEvent> <bpmn:sequenceFlow id="SequenceFlow_1mkhog2" sourceRef="Task_1hs1mn0" targetRef="EndEvent_0lgvk82" /> - <bpmn:callActivity id="CallActivity_1gfzi2g" name="Abstract CDS (CDS Call) " calledElement="AbstractCDSProcessingBB"> - <bpmn:extensionElements> - <camunda:out source="WorkflowException" target="WorkflowException" /> - <camunda:out source="ControllerStatus" target="ControllerStatus" /> - <camunda:in source="executionObject" target="executionObject" /> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_05qembo</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0cvsnuu</bpmn:outgoing> - </bpmn:callActivity> - <bpmn:serviceTask id="Task_1hs1mn0" name="Update AAI" camunda:expression="${AAIUpdateTasks.updateOrchestrationStatus(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")),InjectExecution.execute(execution, execution.getVariable("scope")),InjectExecution.execute(execution, execution.getVariable("action")))}"> + <bpmn:serviceTask id="Task_1hs1mn0" name="Update AAI" camunda:expression="${AAIUpdateTasks.updateOrchestrationStatus(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")), execution.getVariable("scope"), execution.getVariable("action"))}"> <bpmn:incoming>SequenceFlow_07tqu82</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1mkhog2</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_05qembo" sourceRef="Task_0bhf6tp" targetRef="CallActivity_1gfzi2g" /> - <bpmn:serviceTask id="Task_0bhf6tp" name="PreProcess Abstract CDS Processing" camunda:expression="${GenericCDSProcessing.buildPayloadBasedOnScopeAndAction(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:sequenceFlow id="SequenceFlow_05qembo" sourceRef="Task_0bhf6tp" targetRef="ExclusiveGateway_13q340y" /> + <bpmn:serviceTask id="Task_0bhf6tp" name="Call ControllerExecutionBB" camunda:expression="${ControllerExecutionBB.execute(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_0vzx2yr</bpmn:incoming> <bpmn:outgoing>SequenceFlow_05qembo</bpmn:outgoing> </bpmn:serviceTask> <bpmn:exclusiveGateway id="ExclusiveGateway_13q340y" default="SequenceFlow_15gxql1"> - <bpmn:incoming>SequenceFlow_0cvsnuu</bpmn:incoming> + <bpmn:incoming>SequenceFlow_05qembo</bpmn:incoming> <bpmn:outgoing>SequenceFlow_07tqu82</bpmn:outgoing> <bpmn:outgoing>SequenceFlow_15gxql1</bpmn:outgoing> </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0cvsnuu" sourceRef="CallActivity_1gfzi2g" targetRef="ExclusiveGateway_13q340y" /> <bpmn:sequenceFlow id="SequenceFlow_07tqu82" name="success" sourceRef="ExclusiveGateway_13q340y" targetRef="Task_1hs1mn0"> <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression> </bpmn:sequenceFlow> @@ -81,7 +71,7 @@ </bpmn:endEvent> <bpmn:sequenceFlow id="SequenceFlow_0op5irz" sourceRef="BBToExecute" targetRef="EndEvent_1lxwuh2" /> <bpmn:sequenceFlow id="SequenceFlow_0vzx2yr" name="Actor= CDS" sourceRef="ExclusiveGateway_0plxwkg" targetRef="Task_0bhf6tp"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("controller_actor") == "CDS"}</bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("actor") == "CDS"}</bpmn:conditionExpression> </bpmn:sequenceFlow> </bpmn:process> <bpmn:error id="Error_0aovtfv" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> @@ -94,8 +84,8 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0gmfit3_di" bpmnElement="SequenceFlow_0gmfit3"> - <di:waypoint x="196" y="341" /> - <di:waypoint x="259" y="341" /> + <di:waypoint xsi:type="dc:Point" x="196" y="341" /> + <di:waypoint xsi:type="dc:Point" x="259" y="341" /> <bpmndi:BPMNLabel> <dc:Bounds x="32.5" y="236" width="90" height="20" /> </bpmndi:BPMNLabel> @@ -107,24 +97,21 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1mkhog2_di" bpmnElement="SequenceFlow_1mkhog2"> - <di:waypoint x="1079" y="462" /> - <di:waypoint x="1147" y="462" /> - <di:waypoint x="1147" y="359" /> + <di:waypoint xsi:type="dc:Point" x="1079" y="462" /> + <di:waypoint xsi:type="dc:Point" x="1147" y="462" /> + <di:waypoint xsi:type="dc:Point" x="1147" y="359" /> <bpmndi:BPMNLabel> <dc:Bounds x="918" y="357" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="CallActivity_1gfzi2g_di" bpmnElement="CallActivity_1gfzi2g"> - <dc:Bounds x="725" y="422" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0404s6a_di" bpmnElement="Task_1hs1mn0"> <dc:Bounds x="979" y="422" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_05qembo_di" bpmnElement="SequenceFlow_05qembo"> - <di:waypoint x="672" y="462" /> - <di:waypoint x="725" y="462" /> + <di:waypoint xsi:type="dc:Point" x="672" y="462" /> + <di:waypoint xsi:type="dc:Point" x="868" y="462" /> <bpmndi:BPMNLabel> - <dc:Bounds x="503.5" y="357" width="90" height="20" /> + <dc:Bounds x="725" y="437" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_01mv1si_di" bpmnElement="Task_0bhf6tp"> @@ -136,16 +123,9 @@ <dc:Bounds x="698" y="327" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0cvsnuu_di" bpmnElement="SequenceFlow_0cvsnuu"> - <di:waypoint x="825" y="462" /> - <di:waypoint x="868" y="462" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="651.5" y="357" width="90" height="20" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_07tqu82_di" bpmnElement="SequenceFlow_07tqu82"> - <di:waypoint x="918" y="462" /> - <di:waypoint x="979" y="462" /> + <di:waypoint xsi:type="dc:Point" x="918" y="462" /> + <di:waypoint xsi:type="dc:Point" x="979" y="462" /> <bpmndi:BPMNLabel> <dc:Bounds x="856" y="409" width="41" height="14" /> </bpmndi:BPMNLabel> @@ -157,8 +137,8 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_15gxql1_di" bpmnElement="SequenceFlow_15gxql1"> - <di:waypoint x="893" y="487" /> - <di:waypoint x="893" y="565" /> + <di:waypoint xsi:type="dc:Point" x="893" y="487" /> + <di:waypoint xsi:type="dc:Point" x="893" y="565" /> <bpmndi:BPMNLabel> <dc:Bounds x="713" y="436" width="90" height="20" /> </bpmndi:BPMNLabel> @@ -167,8 +147,8 @@ <dc:Bounds x="259" y="301" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_05j6hg6_di" bpmnElement="SequenceFlow_05j6hg6"> - <di:waypoint x="359" y="341" /> - <di:waypoint x="399" y="341" /> + <di:waypoint xsi:type="dc:Point" x="359" y="341" /> + <di:waypoint xsi:type="dc:Point" x="399" y="341" /> <bpmndi:BPMNLabel> <dc:Bounds x="184" y="240" width="90" height="12" /> </bpmndi:BPMNLabel> @@ -180,8 +160,8 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1lspfyy_di" bpmnElement="SequenceFlow_1lspfyy"> - <di:waypoint x="359" y="341" /> - <di:waypoint x="399" y="341" /> + <di:waypoint xsi:type="dc:Point" x="359" y="341" /> + <di:waypoint xsi:type="dc:Point" x="399" y="341" /> <bpmndi:BPMNLabel> <dc:Bounds x="229" y="240" width="0" height="12" /> </bpmndi:BPMNLabel> @@ -190,24 +170,24 @@ <dc:Bounds x="824" y="168" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1t7hs4k_di" bpmnElement="SequenceFlow_1t7hs4k"> - <di:waypoint x="424" y="316" /> - <di:waypoint x="424" y="208" /> - <di:waypoint x="572" y="208" /> + <di:waypoint xsi:type="dc:Point" x="424" y="316" /> + <di:waypoint xsi:type="dc:Point" x="424" y="208" /> + <di:waypoint xsi:type="dc:Point" x="572" y="208" /> <bpmndi:BPMNLabel> <dc:Bounds x="271" y="89" width="83" height="36" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0no1qag_di" bpmnElement="SequenceFlow_0no1qag"> - <di:waypoint x="924" y="208" /> - <di:waypoint x="1147" y="208" /> - <di:waypoint x="1147" y="323" /> + <di:waypoint xsi:type="dc:Point" x="924" y="208" /> + <di:waypoint xsi:type="dc:Point" x="1147" y="208" /> + <di:waypoint xsi:type="dc:Point" x="1147" y="323" /> <bpmndi:BPMNLabel> <dc:Bounds x="840.5" y="107" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0fv03vt_di" bpmnElement="SequenceFlow_0fv03vt"> - <di:waypoint x="672" y="208" /> - <di:waypoint x="824" y="208" /> + <di:waypoint xsi:type="dc:Point" x="672" y="208" /> + <di:waypoint xsi:type="dc:Point" x="824" y="208" /> <bpmndi:BPMNLabel> <dc:Bounds x="598" y="107" width="0" height="12" /> </bpmndi:BPMNLabel> @@ -222,16 +202,16 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0op5irz_di" bpmnElement="SequenceFlow_0op5irz"> - <di:waypoint x="874" y="168" /> - <di:waypoint x="874" y="120" /> + <di:waypoint xsi:type="dc:Point" x="874" y="168" /> + <di:waypoint xsi:type="dc:Point" x="874" y="120" /> <bpmndi:BPMNLabel> <dc:Bounds x="739" y="58" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0vzx2yr_di" bpmnElement="SequenceFlow_0vzx2yr"> - <di:waypoint x="424" y="366" /> - <di:waypoint x="424" y="462" /> - <di:waypoint x="572" y="462" /> + <di:waypoint xsi:type="dc:Point" x="424" y="366" /> + <di:waypoint xsi:type="dc:Point" x="424" y="462" /> + <di:waypoint xsi:type="dc:Point" x="572" y="462" /> <bpmndi:BPMNLabel> <dc:Bounds x="455" y="436" width="60" height="12" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy index 71da2abd05..4e07703fde 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy @@ -383,9 +383,6 @@ class CreateCommunicationService extends AbstractServiceTaskProcessor { } e2eInputMap.put("sNSSAI", execution.getVariable("sNSSAI_id")) - e2eInputMap.put("areaTrafficCapDL", 100) - e2eInputMap.put("areaTrafficCapUL", 100) - e2eInputMap.put("sST", execution.getVariable("csServiceType")) execution.setVariable("e2eInputMap", e2eInputMap) execution.setVariable("e2eServiceType", e2eServiceDecomposition.getServiceType()) diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java index b6ab9d0ce6..d8184da87a 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java @@ -7,6 +7,7 @@ * Modifications Copyright (c) 2019 Samsung * Modifications Copyright (c) 2019 Bell Canada. * Modifications Copyright (c) 2020 Nokia + * Modifications Copyright (c) 2020 Tech Mahindra * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -569,6 +570,21 @@ public class AAIUpdateTasks { updateOrchestrationStatusForVnf(execution, OrchestrationStatus.CONFIGURED); } + /** + * BPMN access method to update status of Vnf/vfmodule to configAssigned/ConfigDeployed in AAI + */ + public void updateOrchestrationStatus(BuildingBlockExecution execution, String scope, String action) { + if (scope.equalsIgnoreCase("vnf") && action.equalsIgnoreCase("config-assign")) { + updateOrchestrationStatusForVnf(execution, OrchestrationStatus.CONFIGASSIGNED); + } else if (scope.equalsIgnoreCase("vnf") && action.equalsIgnoreCase("config-deploy")) { + updateOrchestrationStatusForVnf(execution, OrchestrationStatus.CONFIGDEPLOYED); + } else if (scope.equalsIgnoreCase("vfModule") && action.equalsIgnoreCase("config-assign")) { + updateOrchestrationStatusForVfModule(execution, OrchestrationStatus.CONFIGASSIGNED); + } else if (scope.equalsIgnoreCase("vfModule") && action.equalsIgnoreCase("config-deploy")) { + updateOrchestrationStatusForVfModule(execution, OrchestrationStatus.CONFIGDEPLOYED); + } + } + private void updateOrchestrationStatusForService(BuildingBlockExecution execution, OrchestrationStatus status) { try { ServiceInstance serviceInstance = diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecution.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecution.java index 86d56005f6..754c377914 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecution.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecution.java @@ -39,7 +39,7 @@ import org.springframework.stereotype.Component; @Component public class ControllerExecution { private static final Logger logger = LoggerFactory.getLogger(ControllerExecution.class); - private static final String CONTROLLER_ACTOR = "controllerActor"; + private static final String CONTROLLER_ACTOR = "actor"; private static final String BUILDING_BLOCK = "buildingBlock"; private static final String SCOPE = "scope"; private static final String ACTION = "action"; @@ -59,9 +59,9 @@ public class ControllerExecution { public void setControllerActorScopeAction(BuildingBlockExecution execution) { try { GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); - String modleUuid = genericVnf.getModelInfoGenericVnf().getModelCustomizationUuid(); + String modelUuid = genericVnf.getModelInfoGenericVnf().getModelCustomizationUuid(); VnfResourceCustomization vnfResourceCustomization = - catalogDbClient.getVnfResourceCustomizationByModelCustomizationUUID(modleUuid); + catalogDbClient.getVnfResourceCustomizationByModelCustomizationUUID(modelUuid); // Fetching Controller Actor at VNF level if null then Controller Actor is set as "APPC" String controllerActor = Optional.ofNullable(vnfResourceCustomization.getControllerActor()).orElse("APPC"); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java index f568026aa5..854678a6a6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2019 Bell Canada * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -34,7 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * For Vnf/Vf-Module/Service BuildingBlockExecution is being used. + * This class is used in context of Building Block flow for configuration of vnf/vfmodule/service. * * @param - BuildingBlockExecution */ @@ -44,15 +46,12 @@ public class GenericCDSProcessingBB implements ControllerRunnable<BuildingBlockE private static final String EXECUTION_OBJECT = "executionObject"; public static final String CDS_ACTOR = "cds"; public static final String VNF_SCOPE = "vnf"; - public static final String VF_MODULE_SCOPE = "vf-module"; + public static final String VF_MODULE_SCOPE = "vfmodule"; @Autowired private ExceptionBuilder exceptionBuilder; @Autowired - private ExtractPojosForBB extractPojosForBB; - - @Autowired private AbstractCDSProcessingBBUtils cdsDispather; @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index eead1761ea..5bb199a1f4 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -8,6 +8,8 @@ * ================================================================================ * Modifications Copyright (c) 2020 Nokia * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -140,6 +142,7 @@ public class WorkflowAction { private static final String ACTIVATENETWORKBB = "ActivateNetworkBB"; private static final String VOLUMEGROUP_DELETE_PATTERN = "(Un|De)(.*)Volume(.*)"; private static final String VOLUMEGROUP_CREATE_PATTERN = "(A|C)(.*)Volume(.*)"; + private static final String CONTROLLER = "Controller"; @Autowired protected BBInputSetup bbInputSetup; @@ -698,8 +701,10 @@ public class WorkflowAction { resourceId = UUID.randomUUID().toString(); } for (ExecuteBuildingBlock ebb : flowsToExecute) { - if (key != null && key.equalsIgnoreCase(ebb.getBuildingBlock().getKey()) - && ebb.getBuildingBlock().getBpmnFlowName().contains(resourceType.toString())) { + if (key != null && key.equalsIgnoreCase(ebb.getBuildingBlock().getKey()) && (ebb.getBuildingBlock() + .getBpmnFlowName().contains(resourceType.toString()) + || (ebb.getBuildingBlock().getBpmnFlowName().contains(CONTROLLER) + && ebb.getBuildingBlock().getBpmnScope().equalsIgnoreCase(resourceType.toString())))) { WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds(); workflowResourceIds.setServiceInstanceId(serviceInstanceId); WorkflowResourceIdsUtils.setResourceIdByWorkflowType(workflowResourceIds, resourceType, resourceId); @@ -1366,7 +1371,8 @@ public class WorkflowAction { addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.SERVICE, orchFlow, requestId, apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false, false); - } else if (orchFlow.getFlowName().contains(VNF)) { + } else if (orchFlow.getFlowName().contains(VNF) || (orchFlow.getFlowName().contains(CONTROLLER) + && (VNF).equalsIgnoreCase(orchFlow.getBpmnScope()))) { addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.VNF, orchFlow, requestId, apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false, false); @@ -1382,7 +1388,8 @@ public class WorkflowAction { addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.VIRTUAL_LINK, orchFlow, requestId, apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, true, false); - } else if (orchFlow.getFlowName().contains(VFMODULE)) { + } else if (orchFlow.getFlowName().contains(VFMODULE) || (orchFlow.getFlowName().contains(CONTROLLER) + && (VFMODULE).equalsIgnoreCase(orchFlow.getBpmnScope()))) { List<Resource> vfModuleResourcesSorted = null; if (requestAction.equals(CREATEINSTANCE) || requestAction.equals(ASSIGNINSTANCE) || requestAction.equals("activateInstance")) { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java index e5b003a437..a7dfe7f7a4 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -753,4 +755,40 @@ public class AAIUpdateTasksTest extends BaseTaskTest { when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.PNF))).thenReturn(pnf); return pnf; } + + @Test + public void updateOrchestrationStatusVnfConfigAssignedTest() throws Exception { + doNothing().when(aaiVnfResources).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.CONFIGASSIGNED); + + aaiUpdateTasks.updateOrchestrationStatus(execution, "vnf", "config-assign"); + + verify(aaiVnfResources, times(1)).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.CONFIGASSIGNED); + } + + @Test + public void updateOrchestrationStatusVnfConfigDeployedTest() throws Exception { + doNothing().when(aaiVnfResources).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.CONFIGDEPLOYED); + + aaiUpdateTasks.updateOrchestrationStatus(execution, "vnf", "config-deploy"); + + verify(aaiVnfResources, times(1)).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.CONFIGDEPLOYED); + } + + @Test + public void updateOrchestrationStatusVfModuleConfigDeployedTest() throws Exception { + doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, + OrchestrationStatus.CONFIGDEPLOYED); + aaiUpdateTasks.updateOrchestrationStatus(execution, "vfmodule", "config-deploy"); + verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, + OrchestrationStatus.CONFIGDEPLOYED); + } + + @Test + public void updateOrchestrationStatusVfModuleConfigAssignedTest() throws Exception { + doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, + OrchestrationStatus.CONFIGASSIGNED); + aaiUpdateTasks.updateOrchestrationStatus(execution, "vfmodule", "config-assign"); + verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, + OrchestrationStatus.CONFIGASSIGNED); + } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecutionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecutionTest.java index 72a987c395..f35939ec39 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecutionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecutionTest.java @@ -99,7 +99,7 @@ public class ControllerExecutionTest extends BaseTaskTest { controllerExecution.setControllerActorScopeAction(execution); assertEquals(TEST_SCOPE, execution.getVariable("scope")); assertEquals(TEST_ACTION, execution.getVariable("action")); - assertEquals(TEST_CONTROLLER_ACTOR, execution.getVariable("controllerActor")); + assertEquals(TEST_CONTROLLER_ACTOR, execution.getVariable("actor")); } @@ -114,7 +114,7 @@ public class ControllerExecutionTest extends BaseTaskTest { bbNameSelectionReference.setScope(TEST_SCOPE); doReturn(bbNameSelectionReference).when(catalogDbClient).getBBNameSelectionReference(TEST_CONTROLLER_ACTOR, TEST_SCOPE, TEST_ACTION); - execution.setVariable("controllerActor", TEST_CONTROLLER_ACTOR); + execution.setVariable("actor", TEST_CONTROLLER_ACTOR); execution.setVariable("scope", TEST_SCOPE); execution.setVariable("action", TEST_ACTION); diff --git a/docs/architecture/SO Internal Arc.pptx b/docs/architecture/SO Internal Arc.pptx Binary files differindex ee4b112b3b..3472b92a73 100644 --- a/docs/architecture/SO Internal Arc.pptx +++ b/docs/architecture/SO Internal Arc.pptx diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 4ad5f5876f..afa31fdf70 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -8,6 +8,238 @@ Service Orchestrator Release Notes The SO provides the highest level of service orchestration in the ONAP architecture. +Version: 1.6.1 +----------------------- + +:Release Date: + +**Docker Images** + +**Dockers released for SO:** + + - onap/so/api-handler-infra + - onap/so/bpmn-infra + - onap/so/catalog-db-adapter + - onap/so/openstack-adapter + - onap/so/request-db-adapter + - onap/so/sdc-controller + - onap/so/sdnc-adapter + - onap/so/so-monitoring + - onap/so/vfc-adapter + - onap/so/vnfm-adapter + - onap/so/ve-vnfm-adapter + - onap/so/nssmf-adapter + +**Release Purpose** + +The main goal of the Frankfurt release was to: + - ETSI alignment improvements - CMCC, Ericcson, Huawei, Samsung, Verizon, ZTE. + - SOL005 adaptation + - SOL003 adaptation + - SOL002 adaptation + - SOL004 Package support by ETSI Catalog Manager and SOL003 Adapter + - PNF orchestration Enhancements - Ericcson, Huawei, Nokia + - PNF software upgrade + - PNF PNP enhancement + - CCVPN Enhancement + - MDONS support - Fujitsu + - Eline support - Bell, Huawei, CMCC + - 5G Slicing - ATT, Amdocs, CMCC, Huawei, Wipro + - CDS integration enhancement - ATT, Bell, Tech Mahindra + - (SO Multi Cloud plugin improvements - Intel) + - HPA - Intel (Testing effort) + +**New Features** + +Features Being considered for F release (As per the resource availability): + ++---------------------------------------------------------------------+ +|SOL005 Adapter supports communication security | ++---------------------------------------------------------------------+ +|SOL005 Adapter supports NS LCM | ++---------------------------------------------------------------------+ +|Multi-domain Optical Network Service Orchestration Support in SO | ++---------------------------------------------------------------------+ +|SOL002 Adapter - supports EM-triggered VNF/VNFC Management | ++---------------------------------------------------------------------+ +|SO Catalog Management Support | ++---------------------------------------------------------------------+ +|Frankfurt release planning milestone | ++---------------------------------------------------------------------+ +|Initiate/ Terminate slice service; Activate/deactivate Slice service | ++---------------------------------------------------------------------+ +|SO support of Network Slicing Demo in Frankfurt | ++---------------------------------------------------------------------+ +|ETSI Alignment Support - SOL003 Adapter Enhancement for Frankfurt | ++---------------------------------------------------------------------+ +|AAI update for VNF improvements | ++---------------------------------------------------------------------+ +|SO Multicloud plugin to Multicloud improvements | ++---------------------------------------------------------------------+ +|SO to CDS Enhancement for Generic Implementation | ++---------------------------------------------------------------------+ +|S3P improvement Requirements | ++---------------------------------------------------------------------+ +|Upgrade the APIs to Policy | ++---------------------------------------------------------------------+ + +**Epics** +- [`SO-2524 <https://jira.onap.org/browse/SO-2524>`__\ ] - Functionality and API Freeze +- [`SO-2519 <https://jira.onap.org/browse/SO-2519>`__\ ] - TSC must have for Frankfurt +- [`SO-2432 <https://jira.onap.org/browse/SO-2432>`__\ ] - Multi-domain Optical Network Service Orchestration Support in SO +- [`SO-2427 <https://jira.onap.org/browse/SO-2427>`__\ ] - SOL002 Adapter - supports EM-triggered VNF/VNFC Management +- [`SO-2404 <https://jira.onap.org/browse/SO-2404>`__\ ] - SO Catalog Management Support +- [`SO-2383 <https://jira.onap.org/browse/SO-2383>`__\ ] - Frankfurt release planning milestone +- [`SO-2368 <https://jira.onap.org/browse/SO-2368>`__\ ] - Support 5G slice orchestration +- [`SO-2281 <https://jira.onap.org/browse/SO-2281>`__\ ] - SO support of Network Slicing Demo in Frankfurt +- [`SO-2156 <https://jira.onap.org/browse/SO-2156>`__\ ] - ETSI Alignment Support - SOL003 Adapter Enhancement for Frankfurt +- [`SO-2087 <https://jira.onap.org/browse/SO-2087>`__\ ] - AAI update for VNF improvements +- [`SO-2086 <https://jira.onap.org/browse/SO-2086>`__\ ] - SO Multicloud plugin to Multicloud improvements +- [`SO-2046 <https://jira.onap.org/browse/SO-2046>`__\ ] - support Java 11 upgrade +- [`SO-1579 <https://jira.onap.org/browse/SO-1579>`__\ ] - SO supports ETSI SOL005 Alignment of its interfaces with NFVO + +**Stories** +- [`SO-2774 <https://jira.onap.org/browse/SO-2774>`__\ ] - simplify fabric into add/delete steps +- [`SO-2772 <https://jira.onap.org/browse/SO-2772>`__\ ] - Add validations to prevent out of order deletes +- [`SO-2770 <https://jira.onap.org/browse/SO-2770>`__\ ] - Added support for volume group request to +- [`SO-2768 <https://jira.onap.org/browse/SO-2768>`__\ ] - mso vnf configuration update composite flow +- [`SO-2767 <https://jira.onap.org/browse/SO-2767>`__\ ] - convert openstack to external tasks +- [`SO-2763 <https://jira.onap.org/browse/SO-2763>`__\ ] - Ingest and Process Service Function +- [`SO-2762 <https://jira.onap.org/browse/SO-2762>`__\ ] - Update Subprocess to use COMPLETE status +- [`SO-2761 <https://jira.onap.org/browse/SO-2761>`__\ ] - Use setVariablesLocal for setting task variables +- [`SO-2753 <https://jira.onap.org/browse/SO-2753>`__\ ] - mso to add support for creating the cloud region +- [`SO-2744 <https://jira.onap.org/browse/SO-2744>`__\ ] - reworked dsl client code to check for outputs +- [`SO-2743 <https://jira.onap.org/browse/SO-2743>`__\ ] - split single and plural graph inventory uris +- [`SO-2735 <https://jira.onap.org/browse/SO-2735>`__\ ] - update poms to be compatible with eclipse IDE +- [`SO-2726 <https://jira.onap.org/browse/SO-2726>`__\ ] - Added check to prevent camunda history lookup on +- [`SO-2717 <https://jira.onap.org/browse/SO-2717>`__\ ] - Added git attributes to convert line endings to +- [`SO-2715 <https://jira.onap.org/browse/SO-2715>`__\ ] - Enhance startTime filtering for OrchestrationRequests +- [`SO-2713 <https://jira.onap.org/browse/SO-2713>`__\ ] - create custom spring aop annotation for logging +- [`SO-2700 <https://jira.onap.org/browse/SO-2700>`__\ ] - mso to store the heat template timeout minutes and +- [`SO-2697 <https://jira.onap.org/browse/SO-2697>`__\ ] - Added simpleNotTaskInfo format modifier +- [`SO-2683 <https://jira.onap.org/browse/SO-2683>`__\ ] - Enhance CSIT for ETSI package management +- [`SO-2680 <https://jira.onap.org/browse/SO-2680>`__\ ] - enhance openstack library +- [`SO-2675 <https://jira.onap.org/browse/SO-2675>`__\ ] - Rename migration script +- [`SO-2674 <https://jira.onap.org/browse/SO-2674>`__\ ] - mso to add tenant name and product family name to +- [`SO-2662 <https://jira.onap.org/browse/SO-2662>`__\ ] - Updated pom to release version of logging library +- [`SO-2660 <https://jira.onap.org/browse/SO-2660>`__\ ] - SO API extension to retrieve all PNF workflow +- [`SO-2657 <https://jira.onap.org/browse/SO-2657>`__\ ] - mso to add support for creating the cloud region +- [`SO-2655 <https://jira.onap.org/browse/SO-2655>`__\ ] - added in graceful shutdown to spring boot +- [`SO-2653 <https://jira.onap.org/browse/SO-2653>`__\ ] - Initial commit to check client alive +- [`SO-2651 <https://jira.onap.org/browse/SO-2651>`__\ ] - Remove unused param +- [`SO-2647 <https://jira.onap.org/browse/SO-2647>`__\ ] - Create ConfigDeployPnfBB +- [`SO-2646 <https://jira.onap.org/browse/SO-2646>`__\ ] - Create ConfigAssignPnfBB +- [`SO-2644 <https://jira.onap.org/browse/SO-2644>`__\ ] - WaitForPnfReadyBB - set orchestration status to Register and then Registered +- [`SO-2642 <https://jira.onap.org/browse/SO-2642>`__\ ] - AssignPnfBB - set orchestration status to Assigned after successful assignment +- [`SO-2641 <https://jira.onap.org/browse/SO-2641>`__\ ] - Include AssignPnfBB, WaitForPnfReadyBB, ActivatePnfBB in Service-Macro-Create flow +- [`SO-2640 <https://jira.onap.org/browse/SO-2640>`__\ ] - AssignPnfBB - store model related PNF parameters in AAI +- [`SO-2637 <https://jira.onap.org/browse/SO-2637>`__\ ] - modifications to create network to add lob +- [`SO-2623 <https://jira.onap.org/browse/SO-2623>`__\ ] - Remove Valet from openstack adapter +- [`SO-2620 <https://jira.onap.org/browse/SO-2620>`__\ ] - Include stack Status Reason when rollback is +- [`SO-2616 <https://jira.onap.org/browse/SO-2616>`__\ ] - add manual handling to rainy day handling for bbs +- [`SO-2615 <https://jira.onap.org/browse/SO-2615>`__\ ] - convert bbinputsetup populate methods to use +- [`SO-2614 <https://jira.onap.org/browse/SO-2614>`__\ ] - Add Neutron Port and Nova Server to Proxy +- [`SO-2607 <https://jira.onap.org/browse/SO-2607>`__\ ] - Create ActivatePnfBB +- [`SO-2606 <https://jira.onap.org/browse/SO-2606>`__\ ] - Create WaitForPnfReadyBB +- [`SO-2605 <https://jira.onap.org/browse/SO-2605>`__\ ] - AssignPnfBB should make a link in AAI between PNF and service instance +- [`SO-2603 <https://jira.onap.org/browse/SO-2603>`__\ ] - Replaced annotation with RepositoryRestResource +- [`SO-2601 <https://jira.onap.org/browse/SO-2601>`__\ ] - Use the timeout from the heat template instead of +- [`SO-2597 <https://jira.onap.org/browse/SO-2597>`__\ ] - removed powermock dependecy and added it to +- [`SO-2596 <https://jira.onap.org/browse/SO-2596>`__\ ] - 1911 create appc adapter micro service +- [`SO-2591 <https://jira.onap.org/browse/SO-2591>`__\ ] - mso stores vnf application id from macro create +- [`SO-2590 <https://jira.onap.org/browse/SO-2590>`__\ ] - configurable aaf user expires +- [`SO-2584 <https://jira.onap.org/browse/SO-2584>`__\ ] - consolidated security configuration +- [`SO-2577 <https://jira.onap.org/browse/SO-2577>`__\ ] - Support for volume groups on replace VF Module. +- [`SO-2572 <https://jira.onap.org/browse/SO-2572>`__\ ] - Remove references to AIC +- [`SO-2571 <https://jira.onap.org/browse/SO-2571>`__\ ] - update so to use 1.6.3 snapshot from the logging +- [`SO-2570 <https://jira.onap.org/browse/SO-2570>`__\ ] - Add simple query format, to limit response content +- [`SO-2568 <https://jira.onap.org/browse/SO-2568>`__\ ] - Create AssignPnfBB +- [`SO-2566 <https://jira.onap.org/browse/SO-2566>`__\ ] - Updated simulator test files +- [`SO-2565 <https://jira.onap.org/browse/SO-2565>`__\ ] - Include service-instance-id and +- [`SO-2564 <https://jira.onap.org/browse/SO-2564>`__\ ] - Refactor WorkflowAction.valiadteResourceIdInAAI - +- [`SO-2561 <https://jira.onap.org/browse/SO-2561>`__\ ] - add application id support to so +- [`SO-2555 <https://jira.onap.org/browse/SO-2555>`__\ ] - refactor fallouthandler +- [`SO-2548 <https://jira.onap.org/browse/SO-2548>`__\ ] - Terminate Slice Instance +- [`SO-2547 <https://jira.onap.org/browse/SO-2547>`__\ ] - Deactivate Slice Instance +- [`SO-2546 <https://jira.onap.org/browse/SO-2546>`__\ ] - Activate Slice Instance +- [`SO-2545 <https://jira.onap.org/browse/SO-2545>`__\ ] - Instantiate Slice Service +- [`SO-2540 <https://jira.onap.org/browse/SO-2540>`__\ ] - SO API extension to retrieve PNF workflow +- [`SO-2523 <https://jira.onap.org/browse/SO-2523>`__\ ] - vnf and vf module replace requests to make +- [`SO-2516 <https://jira.onap.org/browse/SO-2516>`__\ ] - remove unused columns infra active requests +- [`SO-2515 <https://jira.onap.org/browse/SO-2515>`__\ ] - Create E2E workflow for software upgrade (PNF) +- [`SO-2514 <https://jira.onap.org/browse/SO-2514>`__\ ] - Create dispatcher class for PNF Software upgrade. +- [`SO-2511 <https://jira.onap.org/browse/SO-2511>`__\ ] - Updated to include getEntity extract +- [`SO-2510 <https://jira.onap.org/browse/SO-2510>`__\ ] - Updated to use getEntity API for ServiceProxy +- [`SO-2509 <https://jira.onap.org/browse/SO-2509>`__\ ] - Updated logging library version to 1.6.2-SNAPSHOT +- [`SO-2499 <https://jira.onap.org/browse/SO-2499>`__\ ] - Skip requestId lookup when uri is +- [`SO-2493 <https://jira.onap.org/browse/SO-2493>`__\ ] - update so to use most recent update of logging +- [`SO-2490 <https://jira.onap.org/browse/SO-2490>`__\ ] - add new query for requestdb +- [`SO-2488 <https://jira.onap.org/browse/SO-2488>`__\ ] - refactor repeated duplicate check code to RequestHandlerUtils +- [`SO-2463 <https://jira.onap.org/browse/SO-2463>`__\ ] - Add so-simulator project +- [`SO-2460 <https://jira.onap.org/browse/SO-2460>`__\ ] - MDONS: L1 Service Termination +- [`SO-2459 <https://jira.onap.org/browse/SO-2459>`__\ ] - MDONS: L1 Service Creation +- [`SO-2444 <https://jira.onap.org/browse/SO-2444>`__\ ] - update scheduled tasks to have mdc setup +- [`SO-2442 <https://jira.onap.org/browse/SO-2442>`__\ ] - Add column to catalog db +- [`SO-2439 <https://jira.onap.org/browse/SO-2439>`__\ ] - Authentication and Authorization support between SOL005 Adapter and NFVO +- [`SO-2438 <https://jira.onap.org/browse/SO-2438>`__\ ] - Secured communication support between SOL005 Adapter and NFVO +- [`SO-2428 <https://jira.onap.org/browse/SO-2428>`__\ ] - SOL002 Adapter subscribes and consumes VNF LCM notifications from VNFM (Frankfurt) +- [`SO-2426 <https://jira.onap.org/browse/SO-2426>`__\ ] - feature request to so to save name on deletes +- [`SO-2412 <https://jira.onap.org/browse/SO-2412>`__\ ] - SOL003 Adapter Package Management by leveraging ONAP-ETSI Catalog Manager +- [`SO-2406 <https://jira.onap.org/browse/SO-2406>`__\ ] - Enhance SO SDC Controller to invoke ONAP-ETSI Catalog APIs +- [`SO-2399 <https://jira.onap.org/browse/SO-2399>`__\ ] - Update PNF instance attributes in AAI during instantiation (PnP) workflow +- [`SO-2398 <https://jira.onap.org/browse/SO-2398>`__\ ] - Converted tests to use LATEST +- [`SO-2372 <https://jira.onap.org/browse/SO-2372>`__\ ] - Validate SO Multicloud plugin adapter with Macro call / gr-api +- [`SO-2339 <https://jira.onap.org/browse/SO-2339>`__\ ] - Refactor SO/DMaaP client - move BBS functionality to a workflow Task +- [`SO-2316 <https://jira.onap.org/browse/SO-2316>`__\ ] - SO to support CDS Actor for ScaleoutBB +- [`SO-2312 <https://jira.onap.org/browse/SO-2312>`__\ ] - SO to CDS Enhancement for Generic Implementation +- [`SO-2293 <https://jira.onap.org/browse/SO-2293>`__\ ] - vf-module details in SDNC-Directives to pass through GR-API with v2 +- [`SO-2208 <https://jira.onap.org/browse/SO-2208>`__\ ] - Load proper instanceParams of the object being processed to CDS properties +- [`SO-2165 <https://jira.onap.org/browse/SO-2165>`__\ ] - Add Config deploy to service-macro-delete and CDS transition directives for vnf +- [`SO-2091 <https://jira.onap.org/browse/SO-2091>`__\ ] - Create new SO building blocks - activateNESw +- [`SO-2090 <https://jira.onap.org/browse/SO-2090>`__\ ] - SO-CDS PNF Building Blocks back-end impl +- [`SO-2089 <https://jira.onap.org/browse/SO-2089>`__\ ] - Create a new SO building block - preCheck +- [`SO-2073 <https://jira.onap.org/browse/SO-2073>`__\ ] - Create a new SO building blocks - postCheck +- [`SO-2072 <https://jira.onap.org/browse/SO-2072>`__\ ] - Support PNF CM workflow execution +- [`SO-2071 <https://jira.onap.org/browse/SO-2071>`__\ ] - SO API extension to support PNF Upgrade +- [`SO-2070 <https://jira.onap.org/browse/SO-2070>`__\ ] - a generic decision points for API +- [`SO-2063 <https://jira.onap.org/browse/SO-2063>`__\ ] - AAF integration +- [`SO-1657 <https://jira.onap.org/browse/SO-1657>`__\ ] - Automated testing for the SO Monitoring component +- [`SO-1635 <https://jira.onap.org/browse/SO-1635>`__\ ] - Preload using user_param (without UI changes) +- [`SO-1420 <https://jira.onap.org/browse/SO-1420>`__\ ] - SO should be able to decompose a composite service +- [`SO-1277 <https://jira.onap.org/browse/SO-1277>`__\ ] - Adapt PNF PnP flow to support updated AAI PNF model +- [`SO-994 <https://jira.onap.org/browse/SO-994>`__\ ] - Sonar Issue: Replace duplicate strings with Constants in ServiceInstances +- [`SO-929 <https://jira.onap.org/browse/SO-929>`__\ ] - Removing Sonar reported Vulnerability in AAIObjectMapper file +- [`SO-2 <https://jira.onap.org/browse/SO-2>`__\ ] - MSO should mount vnfs in appc that appc has to manage + +**Key Issues Addressed** + + +**Security Notes** + + Quick Links: + + - `SO project page <https://wiki.onap.org/display/DW/Service+Orchestrator+Project>`_ + - `Passing Badge information for SO <https://bestpractices.coreinfrastructure.org/en/projects/1702>`_ + + +**Known Issues** + N/A + +OJSI Issues + + N/A + +**Upgrade Notes** + + N/A + +**Deprecation Notes** + + N/A + +**Other** + + N/A Version: 5.0.1 ----------------------- diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java index 4517811494..0df2575ed5 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java @@ -66,6 +66,9 @@ public class CamundaVIDRequest { @JsonProperty(CommonConstants.SERVICE_INSTANCE_ID_VARIABLE) private CamundaInput serviceInstanceId; + @JsonProperty(CommonConstants.OPERATION_TYPE) + private CamundaInput operationType; + @JsonProperty(CommonConstants.PNF_CORRELATION_ID) private CamundaInput pnfCorrelationId; @@ -194,6 +197,16 @@ public class CamundaVIDRequest { this.serviceInstanceId = serviceInstanceId; } + @JsonProperty(CommonConstants.OPERATION_TYPE) + public CamundaInput getOperationType() { + return operationType; + } + + @JsonProperty(CommonConstants.OPERATION_TYPE) + public void setOperationType(CamundaInput operationType) { + this.operationType = operationType; + } + @JsonProperty(CommonConstants.PNF_CORRELATION_ID) public CamundaInput getPnfCorrelationId() { return pnfCorrelationId; diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java index bc8af6e690..d4e00743e2 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java @@ -111,7 +111,8 @@ public class CamundaClient extends RequestClient { parameterObject.getVnfType(), parameterObject.getVfModuleType(), parameterObject.getNetworkType(), parameterObject.getRequestDetails(), parameterObject.getApiVersion(), parameterObject.isaLaCarte(), parameterObject.getRequestUri(), parameterObject.getRecipeParamXsd(), - parameterObject.getInstanceGroupId(), parameterObject.isGenerateIdsOnly()); + parameterObject.getInstanceGroupId(), parameterObject.isGenerateIdsOnly(), + parameterObject.getOperationType()); StringEntity input = new StringEntity(jsonReq); input.setContentType(CommonConstants.CONTENT_TYPE_JSON); @@ -170,7 +171,7 @@ public class CamundaClient extends RequestClient { String serviceInstanceId, String pnfCorrelationId, String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId, String serviceType, String vnfType, String vfModuleType, String networkType, String requestDetails, String apiVersion, boolean aLaCarte, String requestUri, - String paramXsd, String instanceGroupId, boolean generateIdsOnly) { + String paramXsd, String instanceGroupId, boolean generateIdsOnly, String operationType) { String jsonReq = null; try { @@ -182,6 +183,7 @@ public class CamundaClient extends RequestClient { CamundaIntegerInput recipeTimeoutInput = new CamundaIntegerInput(); CamundaInput requestActionInput = new CamundaInput(); CamundaInput serviceInstanceIdInput = new CamundaInput(); + CamundaInput operationTypeInput = new CamundaInput(); CamundaInput pnfCorrelationIdInput = new CamundaInput(); CamundaInput vnfIdInput = new CamundaInput(); CamundaInput vfModuleIdInput = new CamundaInput(); @@ -199,7 +201,7 @@ public class CamundaClient extends RequestClient { CamundaInput instanceGroupIdInput = new CamundaInput(); CamundaBooleanInput generateIds = new CamundaBooleanInput(); - + operationTypeInput.setValue(StringUtils.defaultString(operationType)); requestIdInput.setValue(StringUtils.defaultString(requestId)); isBaseVfModuleInput.setValue(isBaseVfModule); recipeTimeoutInput.setValue(recipeTimeout); @@ -231,6 +233,7 @@ public class CamundaClient extends RequestClient { camundaRequest.setRecipeTimeout(recipeTimeoutInput); camundaRequest.setRequestAction(requestActionInput); camundaRequest.setServiceInstanceId(serviceInstanceIdInput); + camundaRequest.setOperationType(operationTypeInput); camundaRequest.setPnfCorrelationId(pnfCorrelationIdInput); camundaRequest.setVnfId(vnfIdInput); camundaRequest.setVfModuleId(vfModuleIdInput); diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java index 6d2bbfc613..d667126afa 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java @@ -54,6 +54,7 @@ public final class CommonConstants { public static final String RECIPE_TIMEOUT_VARIABLE = "recipeTimeout"; public static final String REQUEST_ACTION_VARIABLE = "requestAction"; public static final String SERVICE_INSTANCE_ID_VARIABLE = "serviceInstanceId"; + public static final String OPERATION_TYPE = "operationType"; public static final String PNF_CORRELATION_ID = "pnfCorrelationId"; public static final String VNF_ID_VARIABLE = "vnfId"; public static final String VF_MODULE_ID_VARIABLE = "vfModuleId"; diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java index 94c62a9689..2e1e37193d 100644 --- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java +++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java @@ -10,9 +10,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -160,11 +160,12 @@ public class CamundaClientTest { boolean aLaCarte = true; String requestUri = "v7/serviceInstances/assign"; String instanceGroupId = "ff305d54-75b4-431b-adb2-eb6b9e5ff000"; + String operationType = "activation"; String testResult = testClient.wrapVIDRequest(requestId, isBaseVfModule, recipeTimeout, requestAction, serviceInstanceId, pnfCorrelationId, vnfId, vfModuleId, volumeGroupId, networkId, configurationId, serviceType, vnfType, vfModuleType, networkType, requestDetails, apiVersion, aLaCarte, requestUri, "", - instanceGroupId, false); + instanceGroupId, false, operationType); String expected = inputStream("/WrappedVIDRequest.json"); JSONAssert.assertEquals(expected, testResult, false); diff --git a/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json b/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json index 3353f8c7ce..6eebb5f703 100644 --- a/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json +++ b/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json @@ -95,6 +95,10 @@ "generateIdsOnly": { "value": false, "type": "Boolean" + }, + "operationType": { + "value": "activation", + "type": "String" } } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java index 435c3a71ab..651d31b7bf 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -32,6 +34,7 @@ public enum OrchestrationStatus { PENDING_DELETE("PendingDelete", "pending.?delete"), PRECREATED("PreCreated", "pre.?created"), CONFIGASSIGNED("ConfigAssigned", "config.?assigned"), + CONFIGDEPLOYED("ConfigDeployed", "config.?deployed"), CONFIGURE("Configure", "configure"), CONFIGURED("Configured", "configured"), REGISTER("Register", "register"), diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml index 3a9ec375da..1d20e44a87 100644 --- a/packages/docker/pom.xml +++ b/packages/docker/pom.xml @@ -249,29 +249,29 @@ </build> </image> <image> - <name>${docker.image.prefix}/nssmf-adapter</name> + <name>${docker.image.prefix}/nssmf-adapter</name> <build> - <cleanup>try</cleanup> - <dockerFile>docker-files/Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so.adapters:mso-nssmf-adapter</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> + <cleanup>try</cleanup> + <dockerFile>docker-files/Dockerfile.so-nssmf-adapter</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so.adapters:mso-nssmf-adapter</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> <image> <name>${docker.image.prefix}/so-appc-orchestrator</name> <build> diff --git a/packages/docker/src/main/docker/docker-files/Dockerfile.so-nssmf-adapter b/packages/docker/src/main/docker/docker-files/Dockerfile.so-nssmf-adapter new file mode 100644 index 0000000000..ef82da4a12 --- /dev/null +++ b/packages/docker/src/main/docker/docker-files/Dockerfile.so-nssmf-adapter @@ -0,0 +1,32 @@ +FROM onap/so/base-image:1.0 + +ARG http_proxy +ENV HTTP_PROXY=$http_proxy +ENV http_proxy=$HTTP_PROXY +ARG https_proxy +ENV HTTPS_PROXY=$https_proxy +ENV https_proxy=$HTTPS_PROXY + +USER root +RUN mkdir -p /app/config +RUN mkdir -p /app/certificates +RUN mkdir -p /app/logs +RUN mkdir -p /app/ca-certificates +RUN apk update && apk add apache2-utils -y + +COPY maven/app.jar /app +COPY configs/logging/logback-spring.xml /app +COPY scripts/start-app.sh /app +COPY scripts/wait-for.sh /app +COPY ca-certificates/onap-ca.crt /app/ca-certificates/onap-ca.crt +RUN chown -R so:so /app + +USER so +# Springboot configuration (required) +VOLUME /app/config + +# Root certificates (optional) +VOLUME /app/ca-certificates + +WORKDIR /app +ENTRYPOINT ["/app/start-app.sh"] diff --git a/releases/1.6.1.yaml b/releases/1.6.1.yaml new file mode 100644 index 0000000000..b70a24c80e --- /dev/null +++ b/releases/1.6.1.yaml @@ -0,0 +1,33 @@ +--- +distribution_type: 'container' +container_release_tag: '1.6.1' +project: 'so' +log_dir: 'so-maven-docker-stage-frankfurt/40/' +ref: '6a81f739a60d6b725b4825f0f0eb709ab4cf0c67' +containers: + - name: 'so/vnfm-adapter' + version: '1.6.1-20200509T0643' + - name: 'so/catalog-db-adapter' + version: '1.6.1-20200509T0643' + - name: 'so/request-db-adapter' + version: '1.6.1-20200509T0643' + - name: 'so/openstack-adapter' + version: '1.6.1-20200509T0643' + - name: 'so/sdnc-adapter' + version: '1.6.1-20200509T0643' + - name: 'so/vfc-adapter' + version: '1.6.1-20200509T0643' + - name: 'so/sdc-controller' + version: '1.6.1-20200509T0643' + - name: 'so/bpmn-infra' + version: '1.6.1-20200509T0643' + - name: 'so/so-monitoring' + version: '1.6.1-20200509T0643' + - name: 'so/api-handler-infra' + version: '1.6.1-20200509T0643' + - name: 'so/so-appc-orchestrator' + version: '1.6.1-20200509T0643' + - name: 'so/nssmf-adapter' + version: '1.6.1-20200509T0643' + - name: 'so/ve-vnfm-adapter' + version: '1.6.1-20200509T0643'
\ No newline at end of file diff --git a/version.properties b/version.properties index a0756adf2b..922c4fa961 100644 --- a/version.properties +++ b/version.properties @@ -4,7 +4,7 @@ major=1 minor=6 -patch=0 +patch=1 base_version=${major}.${minor}.${patch} |