2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.onap.vid.mso.model
22 import com.fasterxml.jackson.annotation.JsonInclude
23 import com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL
26 /* Based on this model:
31 “modelType”: “vfModule”,
32 “modelInvariantId”: “ff5256d2-5a33-55df-13ab-12abad84e7ff”,
33 “modelVersionId”: “fe6478e5-ea33-3346-ac12-ab121484a3fe”,
34 “modelCustomizationId”: “856f9806-b01a-11e6-80f5-76304dec7eb7”,
35 “modelName”: “vSAMP12..base..module-0”,
38 “cloudConfiguration”: {
39 “lcpCloudRegionId”: “mdt1”,
40 “tenantId”: “88a6ca3ee0394ade9403f075db23167e”
43 “instanceName”: “MSOTEST103a-vSAMP12_base_module-0”,
45 “suppressRollback”: true,
46 “requestorId”: “az2016”
48 "relatedInstanceList": [
50 // This related instance captures the volumeGroup to attach
52 “instanceId”: “17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c”,
53 “instanceName”: “MSOTESTVOL103a-vSAMP12_base_module-0_vol”,
55 “modelType”: “volumeGroup”
61 “instanceId”: “{serviceInstanceId}”,
63 “modelType”: “service”,
64 “modelInvariantId”: “ff3514e3-5a33-55df-13ab-12abad84e7ff”,
65 “modelVersionId”: “fe6985cd-ea33-3346-ac12-ab121484a3fe”,
66 “modelName”: “{parent service model name}”,
73 “instanceId”: “{vnfInstanceId}”,
76 “modelInvariantId”: “ff5256d1-5a33-55df-13ab-12abad84e7ff”,
77 “modelVersionId”: “fe6478e4-ea33-3346-ac12-ab121484a3fe”,
78 “modelName”: “vSAMP12”,
79 "modelVersion": "1.0",
80 “modelCustomizationName”: “vSAMP12 1”,
81 “modelCustomizationId”: “a7f1d08e-b02d-11e6-80f5-76304dec7eb7”
86 “requestParameters”: {
96 data class VfModuleOrVolumeGroupRequestDetails(
97 val modelInfo: ModelInfo,
98 val cloudConfiguration: CloudConfiguration,
99 val requestInfo: RequestInfo,
100 val relatedInstanceList: List<RelatedInstance>?,
101 val requestParameters: RequestParametersVfModuleOrVolumeGroup?)
102 : BaseResourceInstantiationRequestDetails(modelInfo, cloudConfiguration, requestInfo, relatedInstanceList, requestParameters)
104 open class RequestParametersVfModuleOrVolumeGroup internal constructor(
105 userParams: List<UserParamTypes>,
106 val isUsePreload: Boolean,
108 ) : BaseResourceInstantiationRequestDetails.RequestParameters(userParams, testApi)
110 class RequestParametersVfModuleOrVolumeGroupInstantiation(
111 userParams: List<UserParamTypes>,
112 usePreload: Boolean?,
114 ) : RequestParametersVfModuleOrVolumeGroup(userParams, usePreload.orFalse(), testApi)
116 class RequestParametersVfModuleUpgrade(
117 userParams: List<UserParamTypes>,
118 usePreload: Boolean?,
120 @get:JsonInclude(NON_NULL) val retainAssignments: Boolean?,
121 @get:JsonInclude(NON_NULL) val rebuildVolumeGroups: Boolean?
122 ) : RequestParametersVfModuleOrVolumeGroup(userParams, usePreload.orFalse(), testApi)
124 class UserParamMap<K, V> : HashMap<K, V>(), UserParamTypes, MutableMap<K, V>
126 private fun Boolean?.orFalse(): Boolean = this ?: false