From 164596ffc56c1f9a4418a2f3b8f3941896b124f7 Mon Sep 17 00:00:00 2001 From: Mateusz Gołuchowski Date: Thu, 5 Nov 2020 15:47:23 +0100 Subject: Update VID SO API call generation - include PNF instanceName parameter in SO API call (macro) Creation of functionality to prepare service with PNF request which call SO. Issue-ID: VID-695 Signed-off-by: Mateusz Goluchowski Change-Id: I5285ac2ab5e95665244ca18c6549249d9330b1ed --- .../java/org/onap/vid/mso/model/Resources.java | 43 ++++++++++++++++++++++ .../model/ServiceInstantiationRequestDetails.java | 38 ++++++++++++++++--- 2 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 vid-app-common/src/main/java/org/onap/vid/mso/model/Resources.java (limited to 'vid-app-common/src/main/java/org/onap/vid/mso') diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/model/Resources.java b/vid-app-common/src/main/java/org/onap/vid/mso/model/Resources.java new file mode 100644 index 000000000..f0504cdde --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/mso/model/Resources.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * VID + * ================================================================================ + * Copyright (C) 2020 Nokia Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.vid.mso.model; + +import java.util.List; + +public class Resources { + + private final List vnfs; + private final List pnfs; + + public Resources(List vnfs, List pnfs) { + this.vnfs = vnfs; + this.pnfs = pnfs; + } + + public List getVnfs() { + return vnfs; + } + + public List getPnfs() { + return pnfs; + } +} + diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java index acbf778ea..d769aac54 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java @@ -175,8 +175,8 @@ public class ServiceInstantiationRequestDetails { public static class ServiceInstantiationService implements UserParamTypes { private final ServiceInstantiationServiceInner serviceInstantiationServiceInner; - public ServiceInstantiationService(ModelInfo modelInfo, String instanceName, List> instanceParams, ServiceInstantiationVnfList vnfs) { - serviceInstantiationServiceInner = new ServiceInstantiationServiceInner(modelInfo, instanceName, instanceParams, vnfs); + public ServiceInstantiationService(ModelInfo modelInfo, String instanceName, List> instanceParams, List vnfs, List pnfs) { + serviceInstantiationServiceInner = new ServiceInstantiationServiceInner(modelInfo, instanceName, instanceParams, vnfs, pnfs); } @JsonProperty("service") @@ -189,15 +189,15 @@ public class ServiceInstantiationRequestDetails { @JsonInclude(NON_EMPTY) public String instanceName; public List> instanceParams; - public ServiceInstantiationVnfList resources; + public Resources resources; - public ServiceInstantiationServiceInner(ModelInfo modelInfo, String instanceName, List> instanceParams, ServiceInstantiationVnfList vnfs) { + public ServiceInstantiationServiceInner(ModelInfo modelInfo, String instanceName, List> instanceParams, List vnfs, List pnfs) { this.modelInfo.setModelType(modelInfo.getModelType()); this.modelInfo.setModelName(modelInfo.getModelName()); this.modelInfo.setModelVersionId(modelInfo.getModelVersionId()); this.instanceName = instanceName; this.instanceParams = instanceParams; - this.resources = vnfs; + this.resources = new Resources(vnfs, pnfs); } } } @@ -210,6 +210,15 @@ public class ServiceInstantiationRequestDetails { } } + public static class ServiceInstantiationPnfList{ + + public final List pnfs; + + public ServiceInstantiationPnfList(List pnfList) { + this.pnfs = pnfList; + } + } + public static class ServiceInstantiationVnf{ public final ModelInfo modelInfo; public final CloudConfiguration cloudConfiguration; @@ -232,6 +241,25 @@ public class ServiceInstantiationRequestDetails { } } + public static class ServiceInstantiationPnf{ + + public final ModelInfo modelInfo; + public final Platform platform; + public final LineOfBusiness lineOfBusiness; + public final String productFamilyId; + public final List> instanceParams; + @JsonInclude(NON_EMPTY) public final String instanceName; + + public ServiceInstantiationPnf(ModelInfo modelInfo, String platform, String lineOfBusiness, String productFamilyId, List> instanceParams, String instanceName) { + this.modelInfo = modelInfo; + this.platform = new Platform(platform); + this.lineOfBusiness = new LineOfBusiness(lineOfBusiness); + this.productFamilyId = productFamilyId; + this.instanceParams = instanceParams; + this.instanceName = instanceName; + } + } + public static class Platform{ public final String platformName; -- cgit 1.2.3-korg