Merge "Updating swagger.html for software upgrade with schema"
authorByung-Woo Jun <byung-woo.jun@est.tech>
Wed, 26 Aug 2020 11:27:22 +0000 (11:27 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 26 Aug 2020 11:27:22 +0000 (11:27 +0000)
32 files changed:
adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java
adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java
adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java
adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfManager.java
adapters/mso-openstack-adapters/pom.xml
adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy
bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java
common/pom.xml
common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java [new file with mode: 0644]
common/src/main/java/org/onap/so/beans/nsmf/AllocateAnNssi.java
common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java
common/src/main/java/org/onap/so/beans/nsmf/AllocateNssi.java [new file with mode: 0644]
common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java
common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java
common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java [new file with mode: 0644]
common/src/main/java/org/onap/so/beans/nsmf/DeAllocateNssi.java
common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java [new file with mode: 0644]
common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java
common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java [new file with mode: 0644]
common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java [new file with mode: 0644]
common/src/main/java/org/onap/so/beans/nsmf/NsiInfo.java
common/src/main/java/org/onap/so/beans/nsmf/NssiAllocateRequest.java
common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java [new file with mode: 0644]
common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java [new file with mode: 0644]
common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java [new file with mode: 0644]
common/src/main/java/org/onap/so/beans/nsmf/ServiceProfile.java
common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java [new file with mode: 0644]
common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java [new file with mode: 0644]
so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json

index 59c6bec..fa5c57f 100644 (file)
@@ -89,4 +89,23 @@ public final class AuthenticationMethodFactory {
         v3Auth.setScope(scope);
         return v3Auth;
     }
+
+    public final com.woorea.openstack.keystone.v3.model.Authentication getAuthenticationForV3(
+            CloudIdentity cloudIdentity) {
+        Identity identity = new Identity();
+        Password password = new Password();
+        User user = new User();
+        Domain userDomain = new Domain();
+        userDomain.setName(cloudIdentity.getUserDomainName());
+        user.setName(cloudIdentity.getMsoId());
+        user.setPassword(CryptoUtils.decryptCloudConfigPassword(cloudIdentity.getMsoPass()));
+        user.setDomain(userDomain);
+        password.setUser(user);
+        identity.setPassword(password);
+        identity.setMethods(Collections.singletonList("password"));
+        com.woorea.openstack.keystone.v3.model.Authentication v3Auth =
+                new com.woorea.openstack.keystone.v3.model.Authentication();
+        v3Auth.setIdentity(identity);
+        return v3Auth;
+    }
 }
index 1690695..3564b8f 100644 (file)
@@ -107,7 +107,7 @@ public class KeystoneV3Authentication {
         return policy;
     }
 
-    protected String findEndpointURL(List<Service> serviceCatalog, String type, String region, String facing) {
+    public String findEndpointURL(List<Service> serviceCatalog, String type, String region, String facing) {
         for (Service service : serviceCatalog) {
             if (type.equals(service.getType())) {
                 for (Service.Endpoint endpoint : service.getEndpoints()) {
index 63bc235..072ab5a 100644 (file)
 package org.onap.so.openstack.utils;
 
 import java.util.Map;
+import org.onap.so.cloud.authentication.AuthenticationMethodFactory;
 import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.openstack.beans.MsoTenant;
 import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
 import org.onap.so.openstack.exceptions.MsoException;
+import org.onap.so.utils.CryptoUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import com.woorea.openstack.keystone.v3.model.Token;
+import com.woorea.openstack.base.client.OpenStackConnectException;
+import com.woorea.openstack.base.client.OpenStackResponseException;
+import com.woorea.openstack.keystone.v3.Keystone;
+import com.woorea.openstack.keystone.v3.api.TokensResource.Authenticate;
+import com.woorea.openstack.keystone.v3.model.Authentication;
+import com.woorea.openstack.keystone.v3.model.Authentication.Identity;
 
 @Component
 public class MsoKeystoneV3Utils extends MsoTenantUtils {
 
+    @Autowired
+    private AuthenticationMethodFactory authenticationMethodFactory;
+
     @Override
     public String createTenant(String tenantName, String cloudSiteId, Map<String, String> metadata, boolean backout)
             throws MsoException {
@@ -57,4 +71,22 @@ public class MsoKeystoneV3Utils extends MsoTenantUtils {
         return cloudIdentity.getIdentityUrl();
     }
 
+    public Token getKeystoneToken(CloudSite cloudSite) throws MsoException {
+        try {
+            CloudIdentity cloudIdentity = cloudSite.getIdentityService();
+
+            Keystone keystone = new Keystone(cloudIdentity.getIdentityUrl());
+
+            Authentication auth = authenticationMethodFactory.getAuthenticationForV3(cloudIdentity);
+
+            Authenticate authenticate = keystone.tokens().authenticate(auth);
+            return executeAndRecordOpenstackRequest(authenticate);
+
+        } catch (OpenStackResponseException e) {
+            throw keystoneErrorToMsoException(e, "TokenAuth");
+        } catch (OpenStackConnectException e) {
+            throw keystoneErrorToMsoException(e, "TokenAuth");
+        }
+    }
+
 }
index 0e25729..00e5c4a 100644 (file)
@@ -127,13 +127,6 @@ public class NssmfManager {
                 break;
 
             case TRANSPORT:
-                AllocateTnNssi tn = nssmiAllocate.getAllocateTnNssi();
-                assertObjectNotNull(tn);
-                assertObjectNotNull(tn.getNsiInfo());
-                assertObjectNotNull(tn.getNsiInfo().getNsiId());
-                nsiId = tn.getNsiInfo().getNsiId();
-                allocateReq = marshal(tn);
-                allocateUrl = AllocateTnNssi.URL;
                 break;
 
         }
index ad41b0f..eb6cba5 100644 (file)
     <dependency>
       <groupId>commons-validator</groupId>
       <artifactId>commons-validator</artifactId>
-      <version>1.4.0</version>
+      <version>1.4.1</version>
     </dependency>
 
     <!-- added for unit testing -->
index ef2577d..10f39f7 100644 (file)
@@ -49,6 +49,7 @@ import org.apache.commons.validator.routines.InetAddressValidator;
 import org.onap.aai.domain.yang.Flavor;
 import org.onap.aai.domain.yang.Image;
 import org.onap.aai.domain.yang.L3InterfaceIpv4AddressList;
+import org.onap.aai.domain.yang.L3InterfaceIpv6AddressList;
 import org.onap.aai.domain.yang.L3Network;
 import org.onap.aai.domain.yang.LInterface;
 import org.onap.aai.domain.yang.PInterface;
@@ -303,6 +304,8 @@ public class HeatBridgeImpl implements HeatBridgeApi {
         Objects.requireNonNull(osClient, ERR_MSG_NULL_OS_CLIENT);
         List<String> portIds =
                 extractStackResourceIdsByResourceType(stackResources, HeatBridgeConstants.OS_PORT_RESOURCE_TYPE);
+        if (portIds == null)
+            return;
         for (String portId : portIds) {
             Port port = osClient.getPortById(portId);
             Network network = osClient.getNetworkById(port.getNetworkId());
@@ -320,7 +323,7 @@ public class HeatBridgeImpl implements HeatBridgeApi {
                 lIf.setInterfaceRole(port.getvNicType());
             }
             boolean isL2Multicast = false;
-            if (port.getProfile().get("trusted") != null) {
+            if (port.getProfile() != null && port.getProfile().get("trusted") != null) {
                 String trusted = port.getProfile().get("trusted").toString();
                 if (Boolean.parseBoolean(trusted)) {
                     isL2Multicast = true;
@@ -522,6 +525,20 @@ public class HeatBridgeImpl implements HeatBridgeApi {
                                 .cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(port.getDeviceId())
                                 .lInterface(lIf.getInterfaceName()).l3InterfaceIpv4AddressList(ipAddress)),
                         Optional.of(lInterfaceIp));
+            } else if (InetAddressValidator.getInstance().isValidInet6Address(ipAddress)) {
+                Subnet subnet = osClient.getSubnetById(ip.getSubnetId());
+                IPAddressString cidr = new IPAddressString(subnet.getCidr());
+                L3InterfaceIpv6AddressList ipv6 = new L3InterfaceIpv6AddressList();
+                ipv6.setL3InterfaceIpv6Address(ipAddress);
+                ipv6.setNeutronNetworkId(port.getNetworkId());
+                ipv6.setNeutronSubnetId(ip.getSubnetId());
+                ipv6.setL3InterfaceIpv6PrefixLength(Long.parseLong(cidr.getNetworkPrefixLength().toString()));
+
+                transaction.createIfNotExists(
+                        AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
+                                .cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(port.getDeviceId())
+                                .lInterface(lIf.getInterfaceName()).l3InterfaceIpv6AddressList(ipAddress)),
+                        Optional.of(ipv6));
             }
         }
     }
index 8c21e3f..03f6c73 100644 (file)
@@ -423,6 +423,18 @@ public class HeatBridgeImplTest {
         when(port.getProfile()).thenReturn(ImmutableMap.of(HeatBridgeConstants.OS_PCI_SLOT_KEY, pfPciId,
                 HeatBridgeConstants.OS_PHYSICAL_NETWORK_KEY, "physical_network_id"));
 
+        IP ip = mock(IP.class);
+
+        Set<IP> ipSet = new HashSet<>();
+        ipSet.add(ip);
+        when(ip.getIpAddress()).thenReturn("2606:ae00:2e60:100::226");
+        when(ip.getSubnetId()).thenReturn("testSubnetId");
+        when(port.getFixedIps()).thenAnswer(x -> ipSet);
+
+        Subnet subnet = mock(Subnet.class);
+        when(subnet.getCidr()).thenReturn("169.254.100.0/24");
+        when(osClient.getSubnetById("testSubnetId")).thenReturn(subnet);
+
         Network network = mock(Network.class);
         when(network.getId()).thenReturn("test-network-id");
         when(network.getNetworkType()).thenReturn(NetworkType.VLAN);
@@ -446,8 +458,9 @@ public class HeatBridgeImplTest {
         heatbridge.buildAddVserverLInterfacesToAaiAction(stackResources, Arrays.asList("1", "2"), "CloudOwner");
 
         // Assert
-        verify(transaction, times(15)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class));
+        verify(transaction, times(20)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class));
         verify(osClient, times(5)).getPortById(anyString());
+        verify(osClient, times(5)).getSubnetById("testSubnetId");
         verify(osClient, times(10)).getNetworkById(anyString());
     }
 
index 08c032f..1468893 100644 (file)
@@ -64,208 +64,211 @@ import org.slf4j.LoggerFactory
 class SniroHomingV1 extends AbstractServiceTaskProcessor{
 
     private static final Logger logger = LoggerFactory.getLogger( SniroHomingV1.class);
-       ExceptionUtil exceptionUtil = new ExceptionUtil()
-       JsonUtils jsonUtil = new JsonUtils()
-       SniroUtils sniroUtils = new SniroUtils(this)
-
-       /**
-        * This method validates the incoming variables.
-        * The method then prepares the sniro request
-        * and posts it to sniro's rest api.
-        *
-        * @param execution
-        *
-        * @author cb645j
-        */
-       public void callSniro(DelegateExecution execution){
-               execution.setVariable("prefix","HOME_")
-               logger.trace("Started Sniro Homing Call Sniro ")
-               try{
-                       execution.setVariable("rollbackData", null)
-                       execution.setVariable("rolledBack", false)
-
-                       String requestId = execution.getVariable("msoRequestId")
-                       logger.debug("Incoming Request Id is: "  + requestId)
-                       String serviceInstanceId = execution.getVariable("serviceInstanceId")
-                       logger.debug("Incoming Service Instance Id is: "  + serviceInstanceId)
-                       ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
-                       logger.debug("Incoming Service Decomposition is: "  + serviceDecomposition)
-                       String subscriberInfo = execution.getVariable("subscriberInfo")
-                       logger.debug("Incoming Subscriber Information is: "  + subscriberInfo)
-
-                       if(isBlank(requestId) || isBlank(serviceInstanceId) || isBlank(serviceDecomposition.toString()) || isBlank(subscriberInfo)){
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 4000, "A required input variable is missing or null")
-                       }else{
-                               String subId = jsonUtil.getJsonValue(subscriberInfo, "globalSubscriberId")
-                               String subName = jsonUtil.getJsonValue(subscriberInfo, "subscriberName")
-                               String subCommonSiteId = ""
-                               if(jsonUtil.jsonElementExist(subscriberInfo, "subscriberCommonSiteId")){
-                                       subCommonSiteId = jsonUtil.getJsonValue(subscriberInfo, "subscriberCommonSiteId")
-                               }
-                               Subscriber subscriber = new Subscriber(subId, subName, subCommonSiteId)
-
-                               String cloudConfiguration = execution.getVariable("cloudConfiguration") // TODO Currently not being used
-                               String homingParameters = execution.getVariable("homingParameters") // (aka. request parameters) Should be json format. TODO confirm its json format
-
-                               //Authentication
-                               String authHeader = UrnPropertiesReader.getVariable("sniro.manager.headers.auth", execution)
-                               execution.setVariable("BasicAuthHeaderValue", authHeader)
-
-                               //Prepare Callback
-                               String timeout = execution.getVariable("timeout")
-                               if(isBlank(timeout)){
-                                       timeout = UrnPropertiesReader.getVariable("sniro.manager.timeout", execution)
-                                       if(isBlank(timeout)) {
-                                               timeout = "PT30M";
-                                       }
-                               }
-                               logger.debug("Async Callback Timeout will be: " + timeout)
-
-                               execution.setVariable("timeout", timeout);
-                               execution.setVariable("correlator", requestId);
-                               execution.setVariable("messageType", "SNIROResponse");
-
-                               //Build Request & Call Sniro
-                               String sniroRequest = sniroUtils.buildRequest(execution, requestId, serviceDecomposition, subscriber, homingParameters)
-                               execution.setVariable("sniroRequest", sniroRequest)
-                               logger.debug("SNIRO Request is: " + sniroRequest)
-
-                               String endpoint = UrnPropertiesReader.getVariable("sniro.manager.uri.v1", execution)
-                               String host = UrnPropertiesReader.getVariable("sniro.manager.host", execution)
-                               String urlString = host + endpoint
-                               logger.debug("Sniro Url is: " + urlString)
-
-                               URL url = new URL(urlString);
-                               HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.SNIRO)
-                               httpClient.addAdditionalHeader("Authorization", authHeader)
-                               Response httpResponse = httpClient.post(sniroRequest)
-
-                               int responseCode = httpResponse.getStatus()
-
-                               logger.debug("Sniro sync response code is: " + responseCode)
-                               if(httpResponse.hasEntity()){
-                                       logger.debug("Sniro sync response is: " + httpResponse.readEntity(String.class))
-                               }
-
-                               if(responseCode != 202){
-                                       exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from Sniro.")
-                               }
-
-                               logger.trace("Completed Sniro Homing Call Sniro")
-                       }
-               }catch(BpmnError b){
-                       throw b
-               }catch(Exception e){
-                       logger.debug("Error encountered within Homing CallSniro method: " + e)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Homing CallSniro: " + e.getMessage())
-               }
-       }
-
-       /**
-        * This method processes the callback response
-        * and the contained homing solution. It sets
-        * homing solution assignment and license
-        * information to the corresponding resources
-        *
-        * @param execution
-        *
-        * @author cb645j
-        */
-       public void processHomingSolution(DelegateExecution execution){
-               logger.trace("Started Sniro Homing Process Homing Solution")
-               try{
-                       String response = execution.getVariable("asyncCallbackResponse")
-                       logger.debug("Sniro Async Callback Response is: " + response)
-
-                       sniroUtils.validateCallbackResponse(execution, response)
-
-                       ServiceDecomposition decomposition = execution.getVariable("serviceDecomposition")
-                       List<Resource> resourceList = decomposition.getServiceResources()
-
-                       if(JsonUtils.jsonElementExist(response, "solutionInfo.placementInfo")){
-                               String placements = jsonUtil.getJsonValue(response, "solutionInfo.placementInfo")
-                               JSONArray arr = new JSONArray(placements)
-                               for(int i = 0; i < arr.length(); i++){
-                                       JSONObject placement = arr.getJSONObject(i)
-                                       String jsonServiceResourceId = placement.getString("serviceResourceId")
-                                       for(Resource resource:resourceList){
-                                               String serviceResourceId = resource.getResourceId()
-                                               if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
-                                                       //match
-                                                       String inventoryType = placement.getString("inventoryType")
-                                                       resource.getHomingSolution().setInventoryType(InventoryType.valueOf(inventoryType))
-                                                       resource.getHomingSolution().setCloudRegionId(placement.getString("cloudRegionId"))
-                                                       resource.getHomingSolution().setRehome(placement.getBoolean("isRehome"))
-                                                       JSONArray assignmentArr = placement.getJSONArray("assignmentInfo")
-                                                       Map<String, String> assignmentMap = jsonUtil.entryArrayToMap(execution, assignmentArr.toString(), "variableName", "variableValue")
-                                                       resource.getHomingSolution().setCloudOwner(assignmentMap.get("cloudOwner"))
-                                                       resource.getHomingSolution().setAicClli(assignmentMap.get("aicClli"))
-                                                       resource.getHomingSolution().setAicVersion(assignmentMap.get("aicVersion"))
-                                                       if(inventoryType.equalsIgnoreCase("service")){
-                                                               VnfResource vnf = new VnfResource()
-                                                               vnf.setVnfHostname(assignmentMap.get("vnfHostName"))
-                                                               resource.getHomingSolution().setVnf(vnf)
-                                                               resource.getHomingSolution().setServiceInstanceId(placement.getString("serviceInstanceId"))
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-
-                       if(JsonUtils.jsonElementExist(response, "solutionInfo.licenseInfo")){
-                               String licenseInfo = jsonUtil.getJsonValue(response, "solutionInfo.licenseInfo")
-                               JSONArray licenseArr = new JSONArray(licenseInfo)
-                               for(int l = 0; l < licenseArr.length(); l++){
-                                       JSONObject license = licenseArr.getJSONObject(l)
-                                       String jsonServiceResourceId = license.getString("serviceResourceId")
-                                       for(Resource resource:resourceList){
-                                               String serviceResourceId = resource.getResourceId()
-                                               if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
-                                                       //match
-                                                       String jsonEntitlementPoolList = jsonUtil.getJsonValue(license.toString(), "entitlementPoolList")
-                                                       List<String> entitlementPoolList = jsonUtil.StringArrayToList(execution, jsonEntitlementPoolList)
-                                                       resource.getHomingSolution().getLicense().setEntitlementPoolList(entitlementPoolList)
-
-                                                       String jsonLicenseKeyGroupList = jsonUtil.getJsonValue(license.toString(), "licenseKeyGroupList")
-                                                       List<String> licenseKeyGroupList = jsonUtil.StringArrayToList(execution, jsonLicenseKeyGroupList)
-                                                       resource.getHomingSolution().getLicense().setLicenseKeyGroupList(licenseKeyGroupList)
-                                               }
-                                       }
-                               }
-                       }
-                       execution.setVariable("serviceDecomposition", decomposition)
-
-                       logger.trace("Completed Sniro Homing Process Homing Solution")
-               }catch(BpmnError b){
-                       throw b
-               }catch(Exception e){
-                       logger.debug("Error encountered within Homing ProcessHomingSolution method: " + e)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Sniro Homing Process Solution")
-               }
-       }
-
-       /**
-        * This method logs the start of DHVCreateService
-        * to make debugging easier.
-        *
-        * @param - execution
-        * @author cb645j
-        */
-       public String logStart(DelegateExecution execution){
-               String requestId = execution.getVariable("testReqId")
-               if(isBlank(requestId)){
-                       requestId = execution.getVariable("msoRequestId")
-               }
-               execution.setVariable("DHVCS_requestId", requestId)
-               logger.trace("STARTED Homing Subflow for request: "  + requestId + " ")
-               logger.debug("****** Homing Subflow Global Debug Enabled: " + execution.getVariable("isDebugLogEnabled")  + " *****")
-               logger.trace("STARTED Homing Subflow for request: "  + requestId + " ")
-       }
-
-
-       /**
-        * Auto-generated method stub
-        */
-       public void preProcessRequest(DelegateExecution execution){}
+    ExceptionUtil exceptionUtil = new ExceptionUtil()
+    JsonUtils jsonUtil = new JsonUtils()
+    SniroUtils sniroUtils = new SniroUtils(this)
+
+    /**
+     * This method validates the incoming variables.
+     * The method then prepares the sniro request
+     * and posts it to sniro's rest api.
+     *
+     * @param execution
+     *
+     * @author cb645j
+     */
+    public void callSniro(DelegateExecution execution){
+        execution.setVariable("prefix","HOME_")
+        logger.trace("Started Sniro Homing Call Sniro ")
+        try{
+            execution.setVariable("rollbackData", null)
+            execution.setVariable("rolledBack", false)
+
+            String requestId = execution.getVariable("msoRequestId")
+            logger.debug("Incoming Request Id is: "  + requestId)
+            String serviceInstanceId = execution.getVariable("serviceInstanceId")
+            logger.debug("Incoming Service Instance Id is: "  + serviceInstanceId)
+            ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+            logger.debug("Incoming Service Decomposition is: "  + serviceDecomposition)
+            String subscriberInfo = execution.getVariable("subscriberInfo")
+            logger.debug("Incoming Subscriber Information is: "  + subscriberInfo)
+
+            if(isBlank(requestId) || isBlank(serviceInstanceId) || isBlank(serviceDecomposition.toString()) || isBlank(subscriberInfo)){
+                exceptionUtil.buildAndThrowWorkflowException(execution, 4000, "A required input variable is missing or null")
+            }else{
+                String subId = jsonUtil.getJsonValue(subscriberInfo, "globalSubscriberId")
+                String subName = jsonUtil.getJsonValue(subscriberInfo, "subscriberName")
+                String subCommonSiteId = ""
+                if(jsonUtil.jsonElementExist(subscriberInfo, "subscriberCommonSiteId")){
+                    subCommonSiteId = jsonUtil.getJsonValue(subscriberInfo, "subscriberCommonSiteId")
+                }
+                Subscriber subscriber = new Subscriber(subId, subName, subCommonSiteId)
+
+                String cloudConfiguration = execution.getVariable("cloudConfiguration") // TODO Currently not being used
+                String homingParameters = execution.getVariable("homingParameters") // (aka. request parameters) Should be json format. TODO confirm its json format
+
+                //Authentication
+                String authHeader = UrnPropertiesReader.getVariable("sniro.manager.headers.auth", execution)
+                execution.setVariable("BasicAuthHeaderValue", authHeader)
+
+                //Prepare Callback
+                String timeout = execution.getVariable("timeout")
+                if(isBlank(timeout)){
+                    timeout = UrnPropertiesReader.getVariable("sniro.manager.timeout", execution)
+                    if(isBlank(timeout)) {
+                        timeout = "PT30M";
+                    }
+                }
+                logger.debug("Async Callback Timeout will be: " + timeout)
+
+                execution.setVariable("timeout", timeout);
+                execution.setVariable("correlator", requestId);
+                execution.setVariable("messageType", "SNIROResponse");
+
+                //Build Request & Call Sniro
+                String sniroRequest = sniroUtils.buildRequest(execution, requestId, serviceDecomposition, subscriber, homingParameters)
+                execution.setVariable("sniroRequest", sniroRequest)
+                logger.debug("SNIRO Request is: " + sniroRequest)
+
+                String endpoint = UrnPropertiesReader.getVariable("sniro.manager.uri.v1", execution)
+                String host = UrnPropertiesReader.getVariable("sniro.manager.host", execution)
+                String urlString = host + endpoint
+                logger.debug("Sniro Url is: " + urlString)
+
+                URL url = new URL(urlString);
+                HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.SNIRO)
+                httpClient.addAdditionalHeader("Authorization", authHeader)
+                Response httpResponse = httpClient.post(sniroRequest)
+
+                int responseCode = httpResponse.getStatus()
+
+                logger.debug("Sniro sync response code is: " + responseCode)
+                if(httpResponse.hasEntity()){
+                    logger.debug("Sniro sync response is: " + httpResponse.readEntity(String.class))
+                }
+
+                if(responseCode != 202){
+                    exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from Sniro.")
+                }
+
+                logger.trace("Completed Sniro Homing Call Sniro")
+            }
+        }catch(BpmnError b){
+            throw b
+        }catch(Exception e){
+            logger.debug("Error encountered within Homing CallSniro method: " + e)
+            exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Homing CallSniro: " + e.getMessage())
+        }
+    }
+
+    /**
+     * This method processes the callback response
+     * and the contained homing solution. It sets
+     * homing solution assignment and license
+     * information to the corresponding resources
+     *
+     * @param execution
+     *
+     * @author cb645j 
+     */
+    public void processHomingSolution(DelegateExecution execution){
+        logger.trace("Started Sniro Homing Process Homing Solution")
+        try{
+            String response = execution.getVariable("asyncCallbackResponse")
+            logger.debug("Sniro Async Callback Response is: " + response)
+
+            sniroUtils.validateCallbackResponse(execution, response)
+
+            ServiceDecomposition decomposition = execution.getVariable("serviceDecomposition")
+            List<Resource> resourceList = decomposition.getServiceResources()
+
+            if(JsonUtils.jsonElementExist(response, "solutionInfo.placementInfo")){
+                String placements = jsonUtil.getJsonValue(response, "solutionInfo.placementInfo")
+                JSONArray arr = new JSONArray(placements)
+                for(int i = 0; i < arr.length(); i++){
+                    JSONObject placement = arr.getJSONObject(i)
+                    String jsonServiceResourceId = placement.getString("serviceResourceId")
+                    for(Resource resource:resourceList){
+                        String serviceResourceId = resource.getResourceId()
+                        if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
+                            //match
+                            String inventoryType = placement.getString("inventoryType")
+                            resource.getHomingSolution().setInventoryType(InventoryType.valueOf(inventoryType))
+                            resource.getHomingSolution().setCloudRegionId(placement.getString("cloudRegionId"))
+                            resource.getHomingSolution().setRehome(placement.getBoolean("isRehome"))
+                            JSONArray assignmentArr = placement.getJSONArray("assignmentInfo")
+                            Map<String, String> assignmentMap = jsonUtil.entryArrayToMap(execution, assignmentArr.toString(), "variableName", "variableValue")
+                            resource.getHomingSolution().setCloudOwner(assignmentMap.get("cloudOwner"))
+                            resource.getHomingSolution().setAicClli(assignmentMap.get("aicClli"))
+                            resource.getHomingSolution().setAicVersion(assignmentMap.get("aicVersion"))
+                            if(inventoryType.equalsIgnoreCase("service")){
+                                VnfResource vnf = new VnfResource()
+                                vnf.setVnfHostname(assignmentMap.get("vnfHostName"))
+                                resource.getHomingSolution().setVnf(vnf)
+                                resource.getHomingSolution().setServiceInstanceId(placement.getString("serviceInstanceId"))
+                            }
+                            if(placement.getBoolean("isRehome")) {
+                                resource.getHomingSolution().setAllottedResourceId(assignmentMap.get("serviceResourceId"))
+                            }
+                        }
+                    }
+                }
+            }
+
+            if(JsonUtils.jsonElementExist(response, "solutionInfo.licenseInfo")){
+                String licenseInfo = jsonUtil.getJsonValue(response, "solutionInfo.licenseInfo")
+                JSONArray licenseArr = new JSONArray(licenseInfo)
+                for(int l = 0; l < licenseArr.length(); l++){
+                    JSONObject license = licenseArr.getJSONObject(l)
+                    String jsonServiceResourceId = license.getString("serviceResourceId")
+                    for(Resource resource:resourceList){
+                        String serviceResourceId = resource.getResourceId()
+                        if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
+                            //match
+                            String jsonEntitlementPoolList = jsonUtil.getJsonValue(license.toString(), "entitlementPoolList")
+                            List<String> entitlementPoolList = jsonUtil.StringArrayToList(execution, jsonEntitlementPoolList)
+                            resource.getHomingSolution().getLicense().setEntitlementPoolList(entitlementPoolList)
+
+                            String jsonLicenseKeyGroupList = jsonUtil.getJsonValue(license.toString(), "licenseKeyGroupList")
+                            List<String> licenseKeyGroupList = jsonUtil.StringArrayToList(execution, jsonLicenseKeyGroupList)
+                            resource.getHomingSolution().getLicense().setLicenseKeyGroupList(licenseKeyGroupList)
+                        }
+                    }
+                }
+            }
+            execution.setVariable("serviceDecomposition", decomposition)
+
+            logger.trace("Completed Sniro Homing Process Homing Solution")
+        }catch(BpmnError b){
+            throw b
+        }catch(Exception e){
+            logger.debug("Error encountered within Homing ProcessHomingSolution method: " + e)
+            exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Sniro Homing Process Solution")
+        }
+    }
+
+    /**
+     * This method logs the start of DHVCreateService
+     * to make debugging easier.
+     *
+     * @param - execution
+     * @author cb645j
+     */
+    public String logStart(DelegateExecution execution){
+        String requestId = execution.getVariable("testReqId")
+        if(isBlank(requestId)){
+            requestId = execution.getVariable("msoRequestId")
+        }
+        execution.setVariable("DHVCS_requestId", requestId)
+        logger.trace("STARTED Homing Subflow for request: "  + requestId + " ")
+        logger.debug("****** Homing Subflow Global Debug Enabled: " + execution.getVariable("isDebugLogEnabled")  + " *****")
+        logger.trace("STARTED Homing Subflow for request: "  + requestId + " ")
+    }
+
+
+    /**
+     * Auto-generated method stub
+     */
+    public void preProcessRequest(DelegateExecution execution){}
 
 }
index 309b053..ddfb29e 100644 (file)
@@ -37,6 +37,7 @@ public class HomingSolution extends JsonWrapper implements Serializable {
     private InventoryType inventoryType;
     private boolean isRehome;
     private String serviceInstanceId; // TODO should start using si object instead
+    private String allottedResourceId;
     private String cloudOwner;
     private String cloudRegionId;
     private String aicClli;
@@ -74,6 +75,14 @@ public class HomingSolution extends JsonWrapper implements Serializable {
         this.serviceInstanceId = serviceInstanceId;
     }
 
+    public String getAllottedResourceId() {
+        return allottedResourceId;
+    }
+
+    public void setAllottedResourceId(String allottedResourceId) {
+        this.allottedResourceId = allottedResourceId;
+    }
+
     public String getCloudOwner() {
         return cloudOwner;
     }
index 0855448..ff13da4 100644 (file)
         </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>org.projectlombok</groupId>
+      <artifactId>lombok</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.validation</groupId>
+      <artifactId>validation-api</artifactId>
+    </dependency>
     <dependency>
       <groupId>javax.xml.bind</groupId>
       <artifactId>jaxb-api</artifactId>
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java b/common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java
new file mode 100644 (file)
index 0000000..64f1df2
--- /dev/null
@@ -0,0 +1,23 @@
+package org.onap.so.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
+public class AdditionalProperties implements Serializable {
+
+    private static final long serialVersionUID = -4020397418955518175L;
+
+    private SliceProfile sliceProfile;
+
+    private List<EndPoint> endPoints;
+
+    private NsiInfo nsiInfo;
+
+    private String scriptName;
+
+    private ModifyAction modifyAction;
+}
index 484f5b4..156f999 100644 (file)
@@ -25,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 @JsonInclude(JsonInclude.Include.NON_NULL)
 public class AllocateAnNssi {
 
+    @Deprecated
     public final static String URL = "/api/rest/provMns/v1/an/NSS" + "/SliceProfiles";
 
     private String nsstId;
 
-    private String flavorId;
-
     private String nssiId;
 
     private String nssiName;
@@ -51,14 +50,6 @@ public class AllocateAnNssi {
         this.nsstId = nsstId;
     }
 
-    public String getFlavorId() {
-        return flavorId;
-    }
-
-    public void setFlavorId(String flavorId) {
-        this.flavorId = flavorId;
-    }
-
     public String getNssiId() {
         return nssiId;
     }
index d036733..1d8b15e 100644 (file)
@@ -27,6 +27,7 @@ import java.io.Serializable;
 public class AllocateCnNssi implements Serializable {
 
     public final static String URL = "/api/rest/provMns/v1/NSS/SliceProfiles";
+    private static final long serialVersionUID = 4909074863148869163L;
 
     private String nsstId;
 
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AllocateNssi.java b/common/src/main/java/org/onap/so/beans/nsmf/AllocateNssi.java
new file mode 100644 (file)
index 0000000..1dc6d0f
--- /dev/null
@@ -0,0 +1,4 @@
+package org.onap.so.beans.nsmf;
+
+public class AllocateNssi {
+}
index b66fb13..f85cb0c 100644 (file)
 
 package org.onap.so.beans.nsmf;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
 
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class AllocateTnNssi {
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
 
-    public final static String URL = "/api/rest/provMns/v1/tn/NSS" + "/SliceProfiles";
+@Data
+public class AllocateTnNssi implements Serializable {
 
-    private String nsstId;
+    private static final long serialVersionUID = -7069801712339914746L;
 
-    private String flavorId;
+    private List<NetworkSliceInfo> networkSliceInfos;
 
-    private String nssiId;
-
-    private String nssiName;
-
-    private TnSliceProfile sliceProfile;
-
-    private String scriptName;
-
-    private Object extension;
-
-    private NsiInfo nsiInfo;
-
-    public String getNsstId() {
-        return nsstId;
-    }
-
-    public void setNsstId(String nsstId) {
-        this.nsstId = nsstId;
-    }
-
-    public String getFlavorId() {
-        return flavorId;
-    }
-
-    public void setFlavorId(String flavorId) {
-        this.flavorId = flavorId;
-    }
-
-    public String getNssiId() {
-        return nssiId;
-    }
-
-    public void setNssiId(String nssiId) {
-        this.nssiId = nssiId;
-    }
-
-    public String getNssiName() {
-        return nssiName;
-    }
-
-    public void setNssiName(String nssiName) {
-        this.nssiName = nssiName;
-    }
-
-    public TnSliceProfile getSliceProfile() {
-        return sliceProfile;
-    }
-
-    public void setSliceProfile(TnSliceProfile sliceProfile) {
-        this.sliceProfile = sliceProfile;
-    }
-
-    public String getScriptName() {
-        return scriptName;
-    }
-
-    public void setScriptName(String scriptName) {
-        this.scriptName = scriptName;
-    }
-
-    public Object getExtension() {
-        return extension;
-    }
-
-    public void setExtension(Object extension) {
-        this.extension = extension;
-    }
-
-    public NsiInfo getNsiInfo() {
-        return nsiInfo;
-    }
-
-    public void setNsiInfo(NsiInfo nsiInfo) {
-        this.nsiInfo = nsiInfo;
-    }
+    private List<TransportSliceNetwork> transportSliceNetworks;
 }
index 3d60949..653f9ac 100644 (file)
@@ -22,40 +22,31 @@ package org.onap.so.beans.nsmf;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
 import java.util.List;
 
 @JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
 public class AnSliceProfile {
 
-    @JsonProperty("5QI")
-    private String qi;
+    private List<String> sNSSAIList;
+
+    private String sliceProfileId;
 
     private List<String> coverageAreaTAList;
 
     @JsonInclude(JsonInclude.Include.NON_DEFAULT)
     private int latency;
 
-    public String getQi() {
-        return qi;
-    }
+    private List<String> pLMNIdList;
 
-    public void setQi(String qi) {
-        this.qi = qi;
-    }
+    private PerfReq perfReq;
 
-    public List<String> getCoverageAreaTAList() {
-        return coverageAreaTAList;
-    }
+    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
+    private int maxNumberofUEs;
 
-    public void setCoverageAreaTAList(List<String> coverageAreaTAList) {
-        this.coverageAreaTAList = coverageAreaTAList;
-    }
+    private UeMobilityLevel uEMobilityLevel;
 
-    public int getLatency() {
-        return latency;
-    }
+    private ResourceSharingLevel resourceSharingLevel;
 
-    public void setLatency(int latency) {
-        this.latency = latency;
-    }
 }
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java b/common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java
new file mode 100644 (file)
index 0000000..ca0c684
--- /dev/null
@@ -0,0 +1,33 @@
+package org.onap.so.beans.nsmf;
+
+
+import java.io.Serializable;
+
+
+public class ConnectionLink implements Serializable {
+    private static final long serialVersionUID = -1834584960407180427L;
+
+    private String transportEndpointA;
+
+    private String transportEndpointB;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getTransportEndpointA() {
+        return transportEndpointA;
+    }
+
+    public void setTransportEndpointA(String transportEndpointA) {
+        this.transportEndpointA = transportEndpointA;
+    }
+
+    public String getTransportEndpointB() {
+        return transportEndpointB;
+    }
+
+    public void setTransportEndpointB(String transportEndpointB) {
+        this.transportEndpointB = transportEndpointB;
+    }
+}
index 648fd49..1ee83c7 100644 (file)
@@ -26,6 +26,7 @@ import java.util.List;
 @JsonInclude(JsonInclude.Include.NON_NULL)
 public class DeAllocateNssi {
 
+    @Deprecated
     public final static String URL = "/api/rest/provMns/v1/NSS" + "/SliceProfiles/%s";
 
     private String nsiId;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java b/common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java
new file mode 100644 (file)
index 0000000..a55672f
--- /dev/null
@@ -0,0 +1,17 @@
+package org.onap.so.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
+public class EndPoint implements Serializable {
+
+    private static final long serialVersionUID = 2479795890807020491L;
+
+    private String nodeId;
+
+    private Map<String, Object> additionalInfo;
+}
index d720399..f8ff5be 100644 (file)
@@ -26,6 +26,7 @@ import java.io.Serializable;
 @JsonInclude(JsonInclude.Include.NON_NULL)
 public class EsrInfo implements Serializable {
 
+    private static final long serialVersionUID = -7696600990607396263L;
     private String vendor;
 
     private NetworkType networkType;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java b/common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java
new file mode 100644 (file)
index 0000000..8206b52
--- /dev/null
@@ -0,0 +1,5 @@
+package org.onap.so.beans.nsmf;
+
+public enum ModifyAction {
+    allocate, deallocate
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java
new file mode 100644 (file)
index 0000000..67701a1
--- /dev/null
@@ -0,0 +1,16 @@
+package org.onap.so.beans.nsmf;
+
+
+import lombok.Data;
+import java.io.Serializable;
+
+@Data
+public class NetworkSliceInfo implements Serializable {
+    private static final long serialVersionUID = 4401921718259398587L;
+
+    private String snssai;
+
+    private String customer;
+
+    private String serviceType;
+}
index 0ff554d..d1679c6 100644 (file)
@@ -37,11 +37,11 @@ public class NsiInfo {
         this.nsiName = nsiName;
     }
 
-    public void setNsiId(String nsiId) {
-        this.nsiId = nsiId;
-    }
-
     public String getNsiId() {
         return nsiId;
     }
+
+    public void setNsiId(String nsiId) {
+        this.nsiId = nsiId;
+    }
 }
index f72a74a..9a25d6f 100644 (file)
 package org.onap.so.beans.nsmf;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
 
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class NssiAllocateRequest {
+public class NssiAllocateRequest implements Serializable {
 
+    private static final long serialVersionUID = -454145891489457960L;
+
+    @NotNull
     private EsrInfo esrInfo;
 
     private AllocateCnNssi allocateCnNssi;
@@ -33,6 +38,8 @@ public class NssiAllocateRequest {
 
     private AllocateAnNssi allocateAnNssi;
 
+    private ServiceInfo serviceInfo;
+
     public EsrInfo getEsrInfo() {
         return esrInfo;
     }
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java b/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java
new file mode 100644 (file)
index 0000000..e421df4
--- /dev/null
@@ -0,0 +1,32 @@
+package org.onap.so.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import java.io.Serializable;
+
+
+@Data
+public class NssmfAdapterNBIRequest implements Serializable {
+
+    private static final long serialVersionUID = -454145891489457960L;
+
+    @JsonInclude(JsonInclude.Include.NON_NULL)
+    private EsrInfo esrInfo;
+
+    @JsonInclude(JsonInclude.Include.NON_NULL)
+    private ServiceInfo serviceInfo;
+
+    private AllocateCnNssi allocateCnNssi;
+
+    private AllocateTnNssi allocateTnNssi;
+
+    private AllocateAnNssi allocateAnNssi;
+
+    private ActDeActNssi actDeActNssi;
+
+    private DeAllocateNssi deAllocateNssi;
+
+    private String subnetCapabilityQuery;
+
+    private String responseId;
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java b/common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java
new file mode 100644 (file)
index 0000000..5a13933
--- /dev/null
@@ -0,0 +1,54 @@
+package org.onap.so.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import java.io.Serializable;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
+public class NssmfRequest implements Serializable {
+
+    private static final long serialVersionUID = 3313218757241310655L;
+
+    private String name;
+
+    private String modelInvariantUuid;
+
+    private String modelUuid;
+
+    private String globalSubscriberId;
+
+    private String serviceInstanceId;
+
+    private String subscriptionServiceType;
+
+    private NetworkType networkType;
+
+    private Object additionalProperties;
+
+    public NssmfRequest() {}
+
+    public NssmfRequest(ServiceInfo serviceInfo, NetworkType networkType, Object additionalProperties) {
+        this.modelInvariantUuid = serviceInfo.getServiceInvariantUuid();
+        this.modelUuid = serviceInfo.getServiceUuid();
+        this.globalSubscriberId = serviceInfo.getGlobalSubscriberId();
+        this.subscriptionServiceType = serviceInfo.getSubscriptionServiceType();
+        this.networkType = networkType;
+        this.additionalProperties = additionalProperties;
+        this.serviceInstanceId = serviceInfo.getNssiId();
+        this.name = serviceInfo.getNssiName();
+    }
+
+}
+
+
+/**
+ * { "name": "eMBB-001", "modelInvariantUuid": "NSST-C-001-HDBNJ-NSSMF-01-A-ZX", "modelUuid":
+ * "NSST-C-001-HDBNJ-NSSMF-01-A-ZX-UUID", "globalSubscriberId": "5GCustomer", "subscriptionServiceType": "5G",
+ * "networkType": "AN/CN/TN", "additionalProperties": { "sliceProfile": { "snssaiList": [ "001-100001" ],
+ * "sliceProfileId": "ab9af40f13f721b5f13539d87484098", "plmnIdList": [ "460-00", "460-01" ], "perfReq": {
+ * "perfReqEmbbList ": [ { "activityFactor": 50 } ] }, "maxNumberofUEs": 200, "coverageAreaTAList": [ "1", "2", "3", "4"
+ * ], "latency": 2, "resourceSharingLevel": "non-shared" }, "endPoints": [ { "nodeId": "", "additionalInfo": { "xxx":
+ * "xxx" } }, { "nodeId": "", "additionalInfo": { "xxx": "xxx" } } ], "nsiInfo": { "nsiId":
+ * "NSI-M-001-HDBNJ-NSMF-01-A-ZX", "nsiName": "eMBB-001" }, "scriptName": "AN1" } }
+ */
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java
new file mode 100644 (file)
index 0000000..f87c032
--- /dev/null
@@ -0,0 +1,31 @@
+package org.onap.so.beans.nsmf;
+
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class ServiceInfo implements Serializable {
+
+    private static final long serialVersionUID = 7895110339097615695L;
+
+    private String serviceInvariantUuid;
+
+    private String serviceUuid;
+
+    private String globalSubscriberId;
+
+    private String subscriptionServiceType;
+
+    private String serviceType;
+
+    private String nsiId;
+
+    private String nssiId;
+
+    private String sST;
+
+    private String nssiName;
+
+    private String pLMNIdList;
+}
index 6c5d9c6..cc6c9bb 100644 (file)
 package org.onap.so.beans.nsmf;
 
 import java.io.Serializable;
+import java.util.HashMap;
 import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java
new file mode 100644 (file)
index 0000000..6207705
--- /dev/null
@@ -0,0 +1,30 @@
+package org.onap.so.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
+public class SliceProfile implements Serializable {
+
+    private static final long serialVersionUID = 7924389625656716814L;
+
+    private List<String> snssaiList;
+
+    private String sliceProfileId;
+
+    private List<String> plmnIdList;
+
+    private PerfReq perfReq;
+
+    private Integer maxNumberofUEs;
+
+    private List<String> coverageAreaTAList;
+
+    private Integer latency;
+
+    private String resourceSharingLevel;
+
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java b/common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java
new file mode 100644 (file)
index 0000000..bfbbbd3
--- /dev/null
@@ -0,0 +1,12 @@
+package org.onap.so.beans.nsmf;
+
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class TransportSliceNetwork implements Serializable {
+    private static final long serialVersionUID = 809947462399806990L;
+
+    private List<ConnectionLink> connectionLinks;
+}
index 8257e6b..8a7eb9d 100644 (file)
@@ -75,7 +75,8 @@
                                  },
                                  "retirementDate":{
                                     "description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
-                                    "format":"date-time"
+                                    "format":"date-time",
+                                    "type":"string"
                                  }
                               }
                            }
                         },
                         "startTime":{
                            "description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
-                           "format":"date-time"
+                           "format":"date-time",
+                           "type":"string"
                         },
                         "nsInstantiationLevelId":{
                            "description":"An identifier that is unique within a NS descriptor. Representation: string of variable length.\n",
                         },
                         "scaleTime":{
                            "description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
-                           "format":"date-time"
+                           "format":"date-time",
+                           "type":"string"
                         }
                      }
                   },
                         },
                         "updateTime":{
                            "description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
-                           "format":"date-time"
+                           "format":"date-time",
+                           "type":"string"
                         }
                      }
                   },
                                  },
                                  "statusEnteredTime":{
                                     "description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
-                                    "format":"date-time"
+                                    "format":"date-time",
+                                    "type":"string"
                                  },
                                  "nsInstanceId":{
                                     "description":"An identifier with the intention of being globally unique.\n",
                                  },
                                  "startTime":{
                                     "description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
-                                    "format":"date-time"
+                                    "format":"date-time",
+                                    "type":"string"
                                  },
                                  "isAutomaticInvocation":{
                                     "description":"Set to true if this NS LCM operation occurrence has been automatically triggered by the NFVO. This occurs in the case of auto-scaling, auto-healing and when a nested NS is modified as a result of an operation on its composite NS. Set to false otherwise.\n",
                                  },
                                  "operationParams":{
                                     "description":"Input parameters of the LCM operation. This attribute shall be formatted according to the request data type of the related LCM operation. The following mapping between lcmOperationType and the data type of this attribute shall apply: - INSTANTIATE: InstantiateNsRequest - SCALE: ScaleNsRequest - UPDATE: UpdateNsRequest - HEAL: HealNsRequest - TERMINATE: TerminateNsRequest This attribute shall be present if this data type is returned in a response to reading an individual resource, and may be present according to the chosen attribute selector parameter if this data type is returned in a response to a query of a container resource.\n",
-                                    "type":"string",
-                                    "enum":[
-                                       "INSTANTIATE",
-                                       "SCALE",
-                                       "UPDATE",
-                                       "HEAL",
-                                       "TERMINATE"
-                                    ]
+                                    "type":"object"
                                  },
                                  "isCancelPending":{
                                     "description":"If the LCM operation occurrence is in \"PROCESSING\" or \"ROLLING_BACK\" state and the operation is being cancelled, this attribute shall be set to true. Otherwise, it shall be set to false.\n",
                         },
                         "statusEnteredTime":{
                            "description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
-                           "format":"date-time"
+                           "format":"date-time",
+                           "type":"string"
                         },
                         "nsInstanceId":{
                            "description":"An identifier with the intention of being globally unique.\n",
                         },
                         "startTime":{
                            "description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
-                           "format":"date-time"
+                           "format":"date-time",
+                           "type":"string"
                         },
                         "isAutomaticInvocation":{
                            "description":"Set to true if this NS LCM operation occurrence has been automatically triggered by the NFVO. This occurs in the case of auto-scaling, auto-healing and when a nested NS is modified as a result of an operation on its composite NS. Set to false otherwise.\n",
                         },
                         "operationParams":{
                            "description":"Input parameters of the LCM operation. This attribute shall be formatted according to the request data type of the related LCM operation. The following mapping between lcmOperationType and the data type of this attribute shall apply: - INSTANTIATE: InstantiateNsRequest - SCALE: ScaleNsRequest - UPDATE: UpdateNsRequest - HEAL: HealNsRequest - TERMINATE: TerminateNsRequest This attribute shall be present if this data type is returned in a response to reading an individual resource, and may be present according to the chosen attribute selector parameter if this data type is returned in a response to a query of a container resource.\n",
-                           "type":"string",
-                           "enum":[
-                              "INSTANTIATE",
-                              "SCALE",
-                              "UPDATE",
-                              "HEAL",
-                              "TERMINATE"
-                           ]
+                           "type":"object"
                         },
                         "isCancelPending":{
                            "description":"If the LCM operation occurrence is in \"PROCESSING\" or \"ROLLING_BACK\" state and the operation is being cancelled, this attribute shall be set to true. Otherwise, it shall be set to false.\n",
                         },
                         "statusEnteredTime":{
                            "description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
-                           "format":"date-time"
+                           "format":"date-time",
+                           "type":"string"
                         },
                         "nsInstanceId":{
                            "description":"An identifier with the intention of being globally unique.\n",
                         },
                         "startTime":{
                            "description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
-                           "format":"date-time"
+                           "format":"date-time",
+                           "type":"string"
                         },
                         "isAutomaticInvocation":{
                            "description":"Set to true if this NS LCM operation occurrence has been automatically triggered by the NFVO. This occurs in the case of auto-scaling, auto-healing and when a nested NS is modified as a result of an operation on its composite NS. Set to false otherwise.\n",
                         },
                         "operationParams":{
                            "description":"Input parameters of the LCM operation. This attribute shall be formatted according to the request data type of the related LCM operation. The following mapping between lcmOperationType and the data type of this attribute shall apply: - INSTANTIATE: InstantiateNsRequest - SCALE: ScaleNsRequest - UPDATE: UpdateNsRequest - HEAL: HealNsRequest - TERMINATE: TerminateNsRequest This attribute shall be present if this data type is returned in a response to reading an individual resource, and may be present according to the chosen attribute selector parameter if this data type is returned in a response to a query of a container resource.\n",
-                           "type":"string",
-                           "enum":[
-                              "INSTANTIATE",
-                              "SCALE",
-                              "UPDATE",
-                              "HEAL",
-                              "TERMINATE"
-                           ]
+                           "type":"object"
                         },
                         "isCancelPending":{
                            "description":"If the LCM operation occurrence is in \"PROCESSING\" or \"ROLLING_BACK\" state and the operation is being cancelled, this attribute shall be set to true. Otherwise, it shall be set to false.\n",