diff options
author | Amichai Hemli <amichai.hemli@intl.att.com> | 2020-04-30 10:53:23 +0300 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-05-04 11:00:46 +0000 |
commit | 048bd5e527128ab84a2725cd39761648b8ec9c62 (patch) | |
tree | e89edffa6c9523726712cb77f85267c05568508b /vid-app-common/src/main/java/org | |
parent | 80bc6dd4678e2c4057d494ba29c8dd9b0c999abc (diff) |
When cloud region is missing then omit the cloudConfiguration object
Issue-ID: VID-820
Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com>
Change-Id: I0780649982c0a1ae0a5bc56da438d422a710e4bf
Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt | 10 | ||||
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/mso/model/VfModuleOrVolumeGroupRequestDetails.kt | 12 |
2 files changed, 12 insertions, 10 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt index c3fdcdaeb..c31e69300 100644 --- a/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt +++ b/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt @@ -341,11 +341,13 @@ class MsoRequestBuilder return subscriberInfo } - private fun generateCloudConfiguration(lcpCloudRegionId: String?, tenantId: String?): CloudConfiguration { + private fun generateCloudConfiguration(lcpCloudRegionId: String?, tenantId: String?): CloudConfiguration? { + + if (lcpCloudRegionId.isNullOrEmpty()) return null + val cloudConfiguration = CloudConfiguration(lcpCloudRegionId, tenantId) - if (lcpCloudRegionId != null) { - cloudOwnerService.enrichCloudConfigurationWithCloudOwner(cloudConfiguration, lcpCloudRegionId) - } + cloudOwnerService.enrichCloudConfigurationWithCloudOwner(cloudConfiguration, lcpCloudRegionId) + return cloudConfiguration } diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/model/VfModuleOrVolumeGroupRequestDetails.kt b/vid-app-common/src/main/java/org/onap/vid/mso/model/VfModuleOrVolumeGroupRequestDetails.kt index bf9e41ad9..51910c45a 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/model/VfModuleOrVolumeGroupRequestDetails.kt +++ b/vid-app-common/src/main/java/org/onap/vid/mso/model/VfModuleOrVolumeGroupRequestDetails.kt @@ -93,12 +93,12 @@ import java.util.* */ -data class VfModuleOrVolumeGroupRequestDetails( - val modelInfo: ModelInfo, - val cloudConfiguration: CloudConfiguration, - val requestInfo: RequestInfo, - val relatedInstanceList: List<RelatedInstance>?, - val requestParameters: RequestParametersVfModuleOrVolumeGroup?) +class VfModuleOrVolumeGroupRequestDetails( + modelInfo: ModelInfo, + cloudConfiguration: CloudConfiguration?, + requestInfo: RequestInfo, + relatedInstanceList: List<RelatedInstance>?, + requestParameters: RequestParametersVfModuleOrVolumeGroup?) : BaseResourceInstantiationRequestDetails(modelInfo, cloudConfiguration, requestInfo, relatedInstanceList, requestParameters) open class RequestParametersVfModuleOrVolumeGroup internal constructor( |